From: Jakub Jelinek Date: Mon, 12 Jan 2015 20:48:09 +0000 (+0100) Subject: re PR tree-optimization/64563 (ICE with "-Wall -Wextra" at -Os and above on x86_64... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=737fde1df22f8b0bfdc5b39dfc7d5fa280577318;p=gcc.git re PR tree-optimization/64563 (ICE with "-Wall -Wextra" at -Os and above on x86_64-linux-gnu) PR tree-optimization/64563 * tree-vrp.c (vrp_evaluate_conditional): Check for VR_RANGE instead of != VR_VARYING. * gcc.dg/pr64563.c: New test. From-SVN: r219493 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a21711b41a..e3ff175ce8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2015-01-12 Jakub Jelinek + PR tree-optimization/64563 + * tree-vrp.c (vrp_evaluate_conditional): Check for VR_RANGE + instead of != VR_VARYING. + PR target/64513 * config/i386/i386.c (ix86_expand_prologue): Add REG_FRAME_RELATED_EXPR to %rax and %r10 pushes. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1b441e492da..03e7acf7957 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2015-01-12 Jakub Jelinek + PR tree-optimization/64563 + * gcc.dg/pr64563.c: New test. + PR target/64513 * gcc.target/i386/pr64513.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr64563.c b/gcc/testsuite/gcc.dg/pr64563.c new file mode 100644 index 00000000000..7223349c41f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr64563.c @@ -0,0 +1,14 @@ +/* PR tree-optimization/64563 */ +/* { dg-do compile } */ +/* { dg-options "-Os -Wtype-limits" } */ + +int a, b, c, d, f; +unsigned int e; + +void +foo (void) +{ + d = b = (a != (e | 4294967288UL)); + if (!d) + c = f || b; +} diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index ecf86c35666..f3e1d3d6351 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -7545,7 +7545,7 @@ vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, gimple stmt) tree type = TREE_TYPE (op0); value_range_t *vr0 = get_value_range (op0); - if (vr0->type != VR_VARYING + if (vr0->type == VR_RANGE && INTEGRAL_TYPE_P (type) && vrp_val_is_min (vr0->min) && vrp_val_is_max (vr0->max)