[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation

2007-03-13 Thread rguenth at gcc dot gnu dot org
--- Comment #6 from rguenth at gcc dot gnu dot org 2007-03-13 09:30 --- How tracking _two_ value ranges for signed quantities with undefined overflow. One assuming it is undefined and one with wrapping semantics. Whenever you fold something using the value range you warn if the folding

[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation

2007-03-12 Thread ian at airs dot com
--- Comment #4 from ian at airs dot com 2007-03-12 17:08 --- First test case: int f(int a) { if (a 0) a = -a; return a 0; } As far as I can tell the behaviour of this test case in VRP is unchanged by the patch in this PR. And the code is still fully optimized. Second test

[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation

2007-03-12 Thread ian at airs dot com
--- Comment #5 from ian at airs dot com 2007-03-12 17:21 --- Unfortunately my patch in comment #1 doesn't handle this test case correctly: extern void abort (void); void foo (int a) { if (a = (int) 0x8001) { a = - a; if (a 0) abort (); } } It turns

[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation

2007-03-11 Thread ian at airs dot com
--- Comment #1 from ian at airs dot com 2007-03-11 20:39 --- I am testing this patch. Index: gcc/tree-vrp.c === --- gcc/tree-vrp.c (revision 122820) +++ gcc/tree-vrp.c (working copy) @@ -2142,13 +2142,11 @@

[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation

2007-03-11 Thread pinskia at gcc dot gnu dot org
--- Comment #2 from pinskia at gcc dot gnu dot org 2007-03-12 05:43 --- - if (supports_overflow_infinity (TREE_TYPE (expr))) - min = positive_overflow_infinity (TREE_TYPE (expr)); - else - { - set_value_range_to_varying (vr); -

[Bug tree-optimization/31130] [4.3 Regression] VRP no longer derives range for division after negation

2007-03-11 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2007-03-12 06:11 --- How about: extern void link_error (); void foo (int a) { if (a 0) { int y; a *=-2; y = a / 7; if (y 1 30) link_error (); } } int main() { return 0; } Also? Which is