diff options
author | Richard Guenther <rguenther@suse.de> | 2009-04-22 15:41:48 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-04-22 15:41:48 +0000 |
commit | aea4deba9fe05d970dff5a8f16c584680243319f (patch) | |
tree | 830677aad4b37fb8c1aebd51f53cf58a6b139f58 /gcc | |
parent | cfc935327585254eabd5c18f298b1b4bc28a2b02 (diff) | |
download | gcc-aea4deba9fe05d970dff5a8f16c584680243319f.zip gcc-aea4deba9fe05d970dff5a8f16c584680243319f.tar.gz gcc-aea4deba9fe05d970dff5a8f16c584680243319f.tar.bz2 |
re PR middle-end/39824 (ice in fold-const.c)
2009-04-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39824
* tree-ssa-ccp.c (fold_const_aggregate_ref): For INDIRECT_REFs
make sure the types are compatible.
* gcc.c-torture/compile/pr39824.c: New testcase.
From-SVN: r146592
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr39824.c | 26 | ||||
-rw-r--r-- | gcc/tree-ssa-ccp.c | 4 |
4 files changed, 40 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f037097..18a3573 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-04-22 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/39824 + * tree-ssa-ccp.c (fold_const_aggregate_ref): For INDIRECT_REFs + make sure the types are compatible. + 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c++/14875 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 386ce8c..d2ef13c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-04-22 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/39824 + * gcc.c-torture/compile/pr39824.c: New testcase. + 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c++/14875 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39824.c b/gcc/testsuite/gcc.c-torture/compile/pr39824.c new file mode 100644 index 0000000..362fb17 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr39824.c @@ -0,0 +1,26 @@ +static const double internalEndianMagic = 7.949928895127363e-275; +static const unsigned char ieee_754_mantissa_mask[] = { 0x00, 0x0F, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF }; +static inline int +trio_isnan (double number) +{ + int has_mantissa = 0; + unsigned int i; + unsigned char current; + for (i = 0; i < (unsigned int)sizeof(double); i++) + { + current = ((unsigned char *)&number)[(((unsigned char + *)&internalEndianMagic)[7-(i)])]; + has_mantissa |= (current & ieee_754_mantissa_mask[i]); + } + return has_mantissa; +} +void +xmlXPathEqualNodeSetFloat(int nodeNr, double v) +{ + int i; + for (i=0; i<nodeNr; i++) + if (!trio_isnan(v)) + break; +} + diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 9cf2f83..437d426 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1329,7 +1329,9 @@ fold_const_aggregate_ref (tree t) if (TREE_CODE (base) == SSA_NAME && (value = get_value (base)) && value->lattice_val == CONSTANT - && TREE_CODE (value->value) == ADDR_EXPR) + && TREE_CODE (value->value) == ADDR_EXPR + && useless_type_conversion_p (TREE_TYPE (t), + TREE_TYPE (TREE_TYPE (value->value)))) return fold_const_aggregate_ref (TREE_OPERAND (value->value, 0)); break; } |