aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2012-10-19 16:53:39 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2012-10-19 16:53:39 +0000
commitaf89bd042ddf9fff34ad79c16123a4cbf814b003 (patch)
treefedc0eb01fed59fdb431827502037cab4085b813 /gcc/fold-const.c
parentdb2415a9a10916b530b6325c5aa6fa39cfe4f246 (diff)
downloadgcc-af89bd042ddf9fff34ad79c16123a4cbf814b003.zip
gcc-af89bd042ddf9fff34ad79c16123a4cbf814b003.tar.gz
gcc-af89bd042ddf9fff34ad79c16123a4cbf814b003.tar.bz2
re PR middle-end/54945 (Too strong non-aliasing analysis?)
PR54945 From-SVN: r192617
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index b1d811d..053b3f5 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -6731,12 +6731,14 @@ fold_sign_changed_comparison (location_t loc, enum tree_code code, tree type,
&& TREE_TYPE (TREE_OPERAND (arg1, 0)) == inner_type))
return NULL_TREE;
- if ((TYPE_UNSIGNED (inner_type) != TYPE_UNSIGNED (outer_type)
- || POINTER_TYPE_P (inner_type) != POINTER_TYPE_P (outer_type))
+ if (TYPE_UNSIGNED (inner_type) != TYPE_UNSIGNED (outer_type)
&& code != NE_EXPR
&& code != EQ_EXPR)
return NULL_TREE;
+ if (POINTER_TYPE_P (inner_type) != POINTER_TYPE_P (outer_type))
+ return NULL_TREE;
+
if (TREE_CODE (arg1) == INTEGER_CST)
arg1 = force_fit_type_double (inner_type, tree_to_double_int (arg1),
0, TREE_OVERFLOW (arg1));