diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-19 19:27:09 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-04-19 19:27:09 +0000 |
commit | 4a1b62d7e52b583fe234819be8ee9ba211b3f375 (patch) | |
tree | e92d2d185b565e9dbbadd2eab3b245262ecb273f /gcc/testsuite/gcc.c-torture/execute | |
parent | dad18bfe5469570a123140c6d0c52927449e09c1 (diff) |
PR tree-optimization/80426
* tree-vrp.c (extract_range_from_binary_expr_1): For an additive
operation on symbolic operands, also compute the overflow for the
invariant part when the operation degenerates into a negation.
PR tree-optimization/80426
* gcc.c-torture/execute/20170419-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247007 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20170429-1.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20170429-1.c b/gcc/testsuite/gcc.c-torture/execute/20170429-1.c new file mode 100644 index 00000000000..f59dbc7a057 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20170429-1.c @@ -0,0 +1,24 @@ +/* PR tree-optimization/80426 */ +/* Testcase by <ishiura-compiler@ml.kwansei.ac.jp> */ + +#define INT_MAX 0x7fffffff +#define INT_MIN (-INT_MAX-1) + +int x; + +int main (void) +{ + volatile int a = 0; + volatile int b = -INT_MAX; + int j; + + for(j = 0; j < 18; j += 1) { + x = ( (a == 0) != (b - (int)(INT_MIN) ) ); + } + + if (x != 0) + __builtin_abort (); + + return 0; +} + |