summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cse.c7
-rw-r--r--gcc/cselib.c7
-rw-r--r--gcc/expr.c45
-rw-r--r--gcc/print-rtl.c3
-rw-r--r--gcc/rtl.h5
5 files changed, 30 insertions, 37 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 5c8bfd0e663..441f949afe1 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2337,11 +2337,8 @@ hash_rtx_cb (const_rtx x, enum machine_mode mode,
return hash;
case CONST_WIDE_INT:
- {
- int i;
- for (i = 0; i < CONST_WIDE_INT_NUNITS (x); i++)
- hash += CONST_WIDE_INT_ELT (x, i);
- }
+ for (i = 0; i < CONST_WIDE_INT_NUNITS (x); i++)
+ hash += CONST_WIDE_INT_ELT (x, i);
return hash;
case CONST_DOUBLE:
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 5ebfebd15e8..80b62c3c055 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1121,11 +1121,8 @@ cselib_hash_rtx (rtx x, int create, enum machine_mode memmode)
return hash ? hash : (unsigned int) CONST_INT;
case CONST_WIDE_INT:
- {
- int i;
- for (i = 0; i < CONST_WIDE_INT_NUNITS (x); i++)
- hash += CONST_WIDE_INT_ELT (x, i);
- }
+ for (i = 0; i < CONST_WIDE_INT_NUNITS (x); i++)
+ hash += CONST_WIDE_INT_ELT (x, i);
return hash;
case CONST_DOUBLE:
diff --git a/gcc/expr.c b/gcc/expr.c
index 6e23c883138..2a82e3e4ceb 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -727,12 +727,11 @@ convert_modes (enum machine_mode mode, enum machine_mode oldmode, rtx x, int uns
if (mode == oldmode)
return x;
- if (CONST_SCALAR_INT_P (x)
- && GET_MODE_CLASS (mode) == MODE_INT)
+ if (CONST_SCALAR_INT_P (x) && GET_MODE_CLASS (mode) == MODE_INT)
{
- /* If the caller did not tell us the old mode, then there is
- not much to do with respect to canonization. We have to assume
- that all the bits are significant. */
+ /* If the caller did not tell us the old mode, then there is not
+ much to do with respect to canonicalization. We have to
+ assume that all the bits are significant. */
if (GET_MODE_CLASS (oldmode) != MODE_INT)
oldmode = MAX_MODE_INT;
wide_int w = wide_int::from (std::make_pair (x, oldmode),
@@ -5298,10 +5297,10 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
&alt_rtl);
}
- /* If TEMP is a VOIDmode constant and the mode of the type of EXP is
- not the same as that of TARGET, adjust the constant. This is
- needed, for example, in case it is a CONST_DOUBLE or
- CONST_WIDE_INT and we want only a word-sized value. */
+ /* If TEMP is a VOIDmode constant and the mode of the type of EXP is not
+ the same as that of TARGET, adjust the constant. This is needed, for
+ example, in case it is a CONST_DOUBLE or CONST_WIDE_INT and we want
+ only a word-sized value. */
if (CONSTANT_P (temp) && GET_MODE (temp) == VOIDmode
&& TREE_CODE (exp) != ERROR_MARK
&& GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
@@ -9478,19 +9477,18 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return decl_rtl;
case INTEGER_CST:
- {
- tree type = TREE_TYPE (exp);
- /* One could argue that GET_MODE_PRECISION (TYPE_MODE (type))
- should always be the same as TYPE_PRECISION (type).
- However, it is not. Since we are converting from tree to
- rtl, we have to expose this ugly truth here. */
- temp = immed_wide_int_const (wide_int::from
- (exp,
- GET_MODE_PRECISION (TYPE_MODE (type)),
- TYPE_SIGN (type)),
- TYPE_MODE (type));
- return temp;
- }
+ /* "Given that TYPE_PRECISION (type) is not always equal to
+ GET_MODE_PRECISION (TYPE_MODE (type)), we need to extend from
+ the former to the latter according to the signedness of the
+ type". */
+
+ temp = immed_wide_int_const (wide_int::from
+ (exp,
+ GET_MODE_PRECISION (TYPE_MODE (type)),
+ TYPE_SIGN (type)),
+ TYPE_MODE (type));
+ return temp;
+
case VECTOR_CST:
{
tree tmp = NULL_TREE;
@@ -11155,8 +11153,7 @@ const_vector_from_tree (tree exp)
RTVEC_ELT (v, i) = CONST_FIXED_FROM_FIXED_VALUE (TREE_FIXED_CST (elt),
inner);
else
- RTVEC_ELT (v, i)
- = immed_wide_int_const (elt, TYPE_MODE (TREE_TYPE (elt)));
+ RTVEC_ELT (v, i) = immed_wide_int_const (elt, inner);
}
return gen_rtx_CONST_VECTOR (mode, v);
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 40c5c1c5f69..25ecad70aed 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -619,8 +619,7 @@ print_rtx (const_rtx in_rtx)
break;
case CONST_WIDE_INT:
- if (! flag_simple)
- fprintf (outfile, " ");
+ fprintf (outfile, " ");
cwi_output_hex (outfile, in_rtx);
break;
#endif
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 39f121be426..b6d505a50f0 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -347,7 +347,10 @@ struct GTY((chain_next ("RTX_NEXT (&%h)"),
unsigned return_val : 1;
union {
- /* RTXs are free to use up to 32 bit from here. */
+ /* The final union field is aligned to 64 bits on LP64 hosts,
+ giving a 32-bit gap after the fields above. We optimize the
+ layout for that case and use the gap for extra code-specific
+ information. */
/* In a CONST_WIDE_INT (aka hwivec_def), this is the number of
HOST_WIDE_INTs in the hwivec_def. */