aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2013-10-21 18:40:34 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2013-10-21 18:40:34 +0000
commit1e08df0e054341a079e516e1957c8ca8148f916b (patch)
treef83f28779503ada6baf211f13e425689117569ca /gcc/fold-const.c
parent67b5215c7642f7436210b4501c445a42f5846fdd (diff)
downloadgcc-1e08df0e054341a079e516e1957c8ca8148f916b.zip
gcc-1e08df0e054341a079e516e1957c8ca8148f916b.tar.gz
gcc-1e08df0e054341a079e516e1957c8ca8148f916b.tar.bz2
re PR middle-end/58809 (ICE with complex variable in OpenMP reduction clause)
PR middle-end/58809 * fold-const.c (fold_range_test): Return 0 if the type is not an integral type. testsuite/ * gcc.dg/gomp/pr58809.c: New test. From-SVN: r203907
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 2c2b929..021d670 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4970,12 +4970,16 @@ fold_range_test (location_t loc, enum tree_code code, tree type,
int in0_p, in1_p, in_p;
tree low0, low1, low, high0, high1, high;
bool strict_overflow_p = false;
- tree lhs = make_range (op0, &in0_p, &low0, &high0, &strict_overflow_p);
- tree rhs = make_range (op1, &in1_p, &low1, &high1, &strict_overflow_p);
- tree tem;
+ tree tem, lhs, rhs;
const char * const warnmsg = G_("assuming signed overflow does not occur "
"when simplifying range test");
+ if (!INTEGRAL_TYPE_P (type))
+ return 0;
+
+ lhs = make_range (op0, &in0_p, &low0, &high0, &strict_overflow_p);
+ rhs = make_range (op1, &in1_p, &low1, &high1, &strict_overflow_p);
+
/* If this is an OR operation, invert both sides; we will invert
again at the end. */
if (or_op)