aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-05-08 08:19:16 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-05-08 08:19:16 +0000
commitb13e7b6cfc7ecbdd98cbff22e1b1a394c1f50dbc (patch)
treebdfeda8250b35bf9a3fac155385beaae4b0c72f1 /gcc/fold-const.c
parent81464b2cd8f8153d1314a628fdc3dbdbb27a9c02 (diff)
downloadgcc-b13e7b6cfc7ecbdd98cbff22e1b1a394c1f50dbc.zip
gcc-b13e7b6cfc7ecbdd98cbff22e1b1a394c1f50dbc.tar.gz
gcc-b13e7b6cfc7ecbdd98cbff22e1b1a394c1f50dbc.tar.bz2
re PR middle-end/36172 (ice for legal code with -O3)
2008-05-08 Richard Guenther <rguenther@suse.de> PR middle-end/36172 * fold-const.c (operand_equal_p): Two objects which types differ in pointerness are not equal. * gcc.c-torture/compile/pr36172.c: New testcase. From-SVN: r135070
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index db7be87..1250d26 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3033,8 +3033,11 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
/* If both types don't have the same signedness, then we can't consider
them equal. We must check this before the STRIP_NOPS calls
- because they may change the signedness of the arguments. */
- if (TYPE_UNSIGNED (TREE_TYPE (arg0)) != TYPE_UNSIGNED (TREE_TYPE (arg1)))
+ because they may change the signedness of the arguments. As pointers
+ strictly don't have a signedness, require either two pointers or
+ two non-pointers as well. */
+ if (TYPE_UNSIGNED (TREE_TYPE (arg0)) != TYPE_UNSIGNED (TREE_TYPE (arg1))
+ || POINTER_TYPE_P (TREE_TYPE (arg0)) != POINTER_TYPE_P (TREE_TYPE (arg1)))
return 0;
/* If both types don't have the same precision, then it is not safe