re PR tree-optimization/23129 (VRP propagates division of antiranges incorrectly)
2005-08-02 James A. Morrison <phython@gcc.gnu.org> PR tree-optimization/23129 * tree-vrp.c (extract_range_from_binary_expr): Set value range to varying for divisions with anti-ranges. From-SVN: r102653
This commit is contained in:
parent
bf2f958806
commit
08303d5bb4
@ -1,3 +1,9 @@
|
||||
2005-08-02 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
PR tree-optimization/23129
|
||||
* tree-vrp.c (extract_range_from_binary_expr): Set value range to
|
||||
varying for divisions with anti-ranges.
|
||||
|
||||
2005-08-02 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* tree-ssa-dom.c (thread_across_edge): Remove updating here.
|
||||
|
@ -1,3 +1,7 @@
|
||||
2005-08-02 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
* gcc.c-torture/execute/vrp-4.c: New test.
|
||||
|
||||
2005-08-02 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* update-threading.c: New test.
|
||||
|
20
gcc/testsuite/gcc.c-torture/execute/vrp-4.c
Normal file
20
gcc/testsuite/gcc.c-torture/execute/vrp-4.c
Normal file
@ -0,0 +1,20 @@
|
||||
extern void exit (int);
|
||||
extern void abort ();
|
||||
|
||||
void test(int x, int y)
|
||||
{
|
||||
int c;
|
||||
|
||||
if (x == 1) abort();
|
||||
if (y == 1) abort();
|
||||
|
||||
c = x / y;
|
||||
|
||||
if (c != 1) abort();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test(2, 2);
|
||||
exit (0);
|
||||
}
|
@ -1136,7 +1136,8 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
|
||||
the new range. */
|
||||
|
||||
/* Divisions by zero result in a VARYING value. */
|
||||
if (code != MULT_EXPR && range_includes_zero_p (&vr1))
|
||||
if (code != MULT_EXPR
|
||||
&& (vr0.type == VR_ANTI_RANGE || range_includes_zero_p (&vr1)))
|
||||
{
|
||||
set_value_range_to_varying (vr);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user