diff options
author | Roger Sayle <roger@eyesopen.com> | 2003-08-20 21:55:01 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2003-08-20 21:55:01 +0000 |
commit | 2cf099a5536d13b14670d122452602a1443b0a7b (patch) | |
tree | 88d6977647ab81cb19002238244071fc6b74411d /gcc/fold-const.c | |
parent | 68ad9159aa8f37386cc910950e1814825e2335b6 (diff) | |
download | gcc-2cf099a5536d13b14670d122452602a1443b0a7b.zip gcc-2cf099a5536d13b14670d122452602a1443b0a7b.tar.gz gcc-2cf099a5536d13b14670d122452602a1443b0a7b.tar.bz2 |
re PR middle-end/11984 (ICE with -ffast_math: expected integer_cst, have real_cst)
PR middle-end/11984
* fold-const.c (fold <PLUS_EXPR>): Check for integer constant
operands before calling tree_int_cst_lt when performing associative
transformations.
* gcc.dg/20030820-1.c: New test case.
From-SVN: r70618
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ef7c086..bf6b1f8 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -5884,7 +5884,9 @@ fold (tree expr) example: ((X*2 + 4) - 8U)/2. */ if (minus_lit0 && lit0) { - if (tree_int_cst_lt (lit0, minus_lit0)) + if (TREE_CODE (lit0) == INTEGER_CST + && TREE_CODE (minus_lit0) == INTEGER_CST + && tree_int_cst_lt (lit0, minus_lit0)) { minus_lit0 = associate_trees (minus_lit0, lit0, MINUS_EXPR, type); |