aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-03-09 21:05:40 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-03-09 21:05:40 +0100
commit2bd8090ff56fdf1ca9ed76a9668a30f4e7d8f949 (patch)
treef35508be294e118a3e7415d51eb9fb7035a843fa /gcc/fold-const.c
parent96b3c82df1fffef2f30045d571589be8d866aaf4 (diff)
downloadgcc-2bd8090ff56fdf1ca9ed76a9668a30f4e7d8f949.zip
gcc-2bd8090ff56fdf1ca9ed76a9668a30f4e7d8f949.tar.gz
gcc-2bd8090ff56fdf1ca9ed76a9668a30f4e7d8f949.tar.bz2
re PR middle-end/70127 (wrong code on x86_64-linux-gnu at -O3 in 32-bit and 64-bit modes)
PR tree-optimization/70127 * fold-const.c (operand_equal_p): Revert the 2015-10-28 change. * gcc.c-torture/execute/pr70127.c: New test. From-SVN: r234090
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 21241db..696b4a6 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3032,6 +3032,9 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
TYPE_SIZE (TREE_TYPE (arg1)),
flags)))
return 0;
+ /* Verify that access happens in similar types. */
+ if (!types_compatible_p (TREE_TYPE (arg0), TREE_TYPE (arg1)))
+ return 0;
/* Verify that accesses are TBAA compatible. */
if (!alias_ptr_types_compatible_p
(TREE_TYPE (TREE_OPERAND (arg0, 1)),