aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-04-09 19:22:20 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-04-09 19:22:20 -0700
commitd8a50944dcea523e77c50326ef46dad2e17deeee (patch)
tree24c2c893ac1cfb34bed6c27b69e8c2db0b69d4bc /gcc/expr.c
parent6a58eee93d2902617dd413fece780497fa03b4b3 (diff)
downloadgcc-d8a50944dcea523e77c50326ef46dad2e17deeee.zip
gcc-d8a50944dcea523e77c50326ef46dad2e17deeee.tar.gz
gcc-d8a50944dcea523e77c50326ef46dad2e17deeee.tar.bz2
expr.c (expand_expr): Force overflows into registers.
* expr.c (expand_expr) [INTEGER_CST]: Force overflows into registers. * gcc.c-torture/compile/20020409-1.c: New. From-SVN: r52104
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 11f1a53..4871c4b 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6318,9 +6318,19 @@ expand_expr (exp, target, tmode, modifier)
return DECL_RTL (exp);
case INTEGER_CST:
- return immed_double_const (TREE_INT_CST_LOW (exp),
+ temp = immed_double_const (TREE_INT_CST_LOW (exp),
TREE_INT_CST_HIGH (exp), mode);
+ /* ??? If overflow is set, fold will have done an incomplete job,
+ which can result in (plus xx (const_int 0)), which can get
+ simplified by validate_replace_rtx during virtual register
+ instantiation, which can result in unrecognizable insns.
+ Avoid this by forcing all overflows into registers. */
+ if (TREE_CONSTANT_OVERFLOW (exp))
+ temp = force_reg (mode, temp);
+
+ return temp;
+
case CONST_DECL:
return expand_expr (DECL_INITIAL (exp), target, VOIDmode, 0);