summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-14 01:37:46 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-14 01:37:46 +0000
commita689a61a730eb53a53223d1d10fe69f7215a5233 (patch)
treed7d30fc341bb1e436b8c390ca7b819b8ece70e80 /gcc/expr.c
parent553c09a8829a6111a10401bbd3c760abf8a5b127 (diff)
downloadgcc-a689a61a730eb53a53223d1d10fe69f7215a5233.tar.gz
* expr.c (copy_blkmode_from_reg): Add missing braces to eliminate
warning and reformat comments. (expand_assignment): Don't pass EXPAND_WRITE if LHS is component. (highest_pow2_factor, case INTEGER_CST): Return BIGGEST_ALIGNMENT if overflow. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 2561fc3d69b..5884217e90e 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -2163,19 +2163,20 @@ copy_blkmode_from_reg (tgtblk, srcreg, type)
preserve_temp_slots (tgtblk);
}
- /* This code assumes srcreg is at least a full word. If it isn't,
- copy it into a new pseudo which is a full word. */
+ /* This code assumes srcreg is at least a full word. If it isn't, copy it
+ into a new pseudo which is a full word.
- /* If FUNCTION_ARG_REG_LITTLE_ENDIAN is set and convert_to_mode does
- a copy, the wrong part of the register gets copied so we fake
- a type conversion in place. */
-
+ If FUNCTION_ARG_REG_LITTLE_ENDIAN is set and convert_to_mode does a copy,
+ the wrong part of the register gets copied so we fake a type conversion
+ in place. */
if (GET_MODE (srcreg) != BLKmode
&& GET_MODE_SIZE (GET_MODE (srcreg)) < UNITS_PER_WORD)
- if (FUNCTION_ARG_REG_LITTLE_ENDIAN)
- srcreg = simplify_gen_subreg (word_mode, srcreg, GET_MODE (srcreg), 0);
- else
- srcreg = convert_to_mode (word_mode, srcreg, TREE_UNSIGNED (type));
+ {
+ if (FUNCTION_ARG_REG_LITTLE_ENDIAN)
+ srcreg = simplify_gen_subreg (word_mode, srcreg, GET_MODE (srcreg), 0);
+ else
+ srcreg = convert_to_mode (word_mode, srcreg, TREE_UNSIGNED (type));
+ }
/* Structures whose size is not a multiple of a word are aligned
to the least significant byte (to the right). On a BYTES_BIG_ENDIAN
@@ -3645,8 +3646,8 @@ expand_assignment (to, from, want_value, suggest_reg)
if (mode1 == VOIDmode && want_value)
tem = stabilize_reference (tem);
- orig_to_rtx = to_rtx = expand_expr (tem, NULL_RTX, VOIDmode,
- EXPAND_WRITE);
+ orig_to_rtx = to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, 0);
+
if (offset != 0)
{
rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0);
@@ -5794,8 +5795,12 @@ highest_pow2_factor (exp)
/* If the integer is expressable in a HOST_WIDE_INT, we can find the
lowest bit that's a one. If the result is zero, pessimize by
returning 1. This is overly-conservative, but such things should not
- happen in the offset expressions that we are called with. */
- if (host_integerp (exp, 0))
+ happen in the offset expressions that we are called with. If
+ the constant overlows, we some erroneous program, so return
+ BIGGEST_ALIGNMENT to avoid any later ICE. */
+ if (TREE_CONSTANT_OVERFLOW (exp))
+ return BIGGEST_ALIGNMENT;
+ else if (host_integerp (exp, 0))
{
c0 = tree_low_cst (exp, 0);
c0 = c0 < 0 ? - c0 : c0;