mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-08 07:06:48 +08:00
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
This commit is contained in:
parent
68ad9159aa
commit
2cf099a553
@ -1,3 +1,10 @@
|
||||
2003-08-20 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
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.
|
||||
|
||||
2003-08-20 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* tree.h (IS_EXPR_CODE_CLASS): Also include 'r' and 's'.
|
||||
|
@ -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);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2003-08-20 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
PR middle-end/11984
|
||||
* gcc.dg/20030820-1.c: New test case.
|
||||
|
||||
2003-08-20 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/11945
|
||||
|
13
gcc/testsuite/gcc.dg/20030820-1.c
Normal file
13
gcc/testsuite/gcc.dg/20030820-1.c
Normal file
@ -0,0 +1,13 @@
|
||||
/* PR middle-end/11984 */
|
||||
/* The following program used to ICE in fold because we didn't check
|
||||
whether the constants we were reassociating were integer constants
|
||||
before calling tree_int_cst_lt. */
|
||||
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -ffast-math" } */
|
||||
|
||||
double f(double x)
|
||||
{
|
||||
return 1.0 - x - 0.1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user