Commit 9b918e82 by Aldy Hernandez Committed by Aldy Hernandez

re PR tree-optimization/87415 (wrong code at -O1 and above on x86_64-linux-gnu)

	PR tree-optimization/87415
	* tree-vrp.c (set_value_range_with_overflow): Special case one bit
	precision fields.

From-SVN: r264817
parent 78125561
2018-10-03 Aldy Hernandez <aldyh@redhat.com>
PR tree-optimization/87415
* tree-vrp.c (set_value_range_with_overflow): Special case one bit
precision fields.
2018-10-02 Jeff Law <law@redhat.com>
* gimple-fold.c (get_range_strlen): Only set *nonstr when
/* { dg-do run } */
/* { dg-options "-O2" } */
struct A
{
int b:1;
};
int d;
int main ()
{
struct A e = { 0 };
if (!d)
e.b = -1;
if (!e.b)
__builtin_abort ();
return 0;
}
......@@ -1116,6 +1116,15 @@ set_value_range_with_overflow (value_range &vr,
const unsigned int prec = TYPE_PRECISION (type);
vr.type = VR_RANGE;
vr.equiv = NULL;
/* For one bit precision if max < min, then the swapped
range covers all values. */
if (prec == 1 && wi::lt_p (wmax, wmin, sgn))
{
set_value_range_to_varying (&vr);
return;
}
if (TYPE_OVERFLOW_WRAPS (type))
{
/* If overflow wraps, truncate the values and adjust the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment