* [Bug tree-optimization/55011] [4.8 Regression] GCC in an infinite loop at -O2 in VRP
2012-10-21 18:31 [Bug middle-end/55011] New: GCC in an infinite loop at -O2 antoine.balestrat at gmail dot com
@ 2012-10-22 9:04 ` rguenth at gcc dot gnu.org
2012-10-22 9:26 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-22 9:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55011
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-10-22
Component|middle-end |tree-optimization
Known to work| |4.7.2
Target Milestone|--- |4.8.0
Summary|GCC in an infinite loop at |[4.8 Regression] GCC in an
|-O2 |infinite loop at -O2 in VRP
Ever Confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-22 09:04:42 UTC ---
Confirmed. Iterating in VRP.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/55011] [4.8 Regression] GCC in an infinite loop at -O2 in VRP
2012-10-21 18:31 [Bug middle-end/55011] New: GCC in an infinite loop at -O2 antoine.balestrat at gmail dot com
2012-10-22 9:04 ` [Bug tree-optimization/55011] [4.8 Regression] GCC in an infinite loop at -O2 in VRP rguenth at gcc dot gnu.org
@ 2012-10-22 9:26 ` jakub at gcc dot gnu.org
2012-10-22 9:44 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-22 9:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55011
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-22 09:26:26 UTC ---
I bet this regressed with
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189885
together with one of r188728, r188776 or r188780 (in between r188700 and
r188800
it started to ICE, and with r189885 it started to loop infinitely instead of
ICEing).
If you want to iterate one more time, I think it would be better to ensure you
iterate just one more time and not infinitely.
Perhaps we could abuse for that the vr_phi_edge_counts array, if
if (edges > 0
&& gimple_phi_num_args (phi) > 1
&& lhs_vr->type == VR_UNDEFINED)
{
if (edges == old_edges)
/* Iterate one more time, but ensure next time we drop to varying
instead of looping forever. */
vr_phi_edge_counts[SSA_NAME_VERSION (lhs)] = -edges;
else if (edges == -old_edges)
goto varying;
}
before the
if (edges > 0
&& gimple_phi_num_args (phi) > 1
&& edges == old_edges
&& lhs_vr->type != VR_UNDEFINED)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/55011] [4.8 Regression] GCC in an infinite loop at -O2 in VRP
2012-10-21 18:31 [Bug middle-end/55011] New: GCC in an infinite loop at -O2 antoine.balestrat at gmail dot com
2012-10-22 9:04 ` [Bug tree-optimization/55011] [4.8 Regression] GCC in an infinite loop at -O2 in VRP rguenth at gcc dot gnu.org
2012-10-22 9:26 ` jakub at gcc dot gnu.org
@ 2012-10-22 9:44 ` rguenth at gcc dot gnu.org
2012-10-22 10:04 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-22 9:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55011
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org
|gnu.org |
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-22 09:44:18 UTC ---
(In reply to comment #2)
> I bet this regressed with
> http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189885
> together with one of r188728, r188776 or r188780 (in between r188700 and
> r188800
> it started to ICE, and with r189885 it started to loop infinitely instead of
> ICEing).
> If you want to iterate one more time, I think it would be better to ensure you
> iterate just one more time and not infinitely.
> Perhaps we could abuse for that the vr_phi_edge_counts array, if
> if (edges > 0
> && gimple_phi_num_args (phi) > 1
> && lhs_vr->type == VR_UNDEFINED)
> {
> if (edges == old_edges)
> /* Iterate one more time, but ensure next time we drop to varying
> instead of looping forever. */
> vr_phi_edge_counts[SSA_NAME_VERSION (lhs)] = -edges;
> else if (edges == -old_edges)
> goto varying;
> }
>
> before the
> if (edges > 0
> && gimple_phi_num_args (phi) > 1
> && edges == old_edges
> && lhs_vr->type != VR_UNDEFINED)
It was supposed to be "iterate one more time as then it will become not
VR_UNDEFINED". I'll investigate.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/55011] [4.8 Regression] GCC in an infinite loop at -O2 in VRP
2012-10-21 18:31 [Bug middle-end/55011] New: GCC in an infinite loop at -O2 antoine.balestrat at gmail dot com
` (2 preceding siblings ...)
2012-10-22 9:44 ` rguenth at gcc dot gnu.org
@ 2012-10-22 10:04 ` rguenth at gcc dot gnu.org
2012-10-22 13:27 ` rguenth at gcc dot gnu.org
2012-10-22 13:27 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-22 10:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55011
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-22 10:03:56 UTC ---
We are iterating between
Visiting PHI node: s_56 = PHI <_53(3), _12(12)>
Argument #0 (3 -> 4 executable)
_53
Value: [63740, +INF] EQUIVALENCES: { _19 } (1 elements)
Argument #1 (12 -> 4 executable)
_12
Value: UNDEFINED
Meeting
[63740, +INF] EQUIVALENCES: { _19 } (1 elements)
and
UNDEFINED
to
[63740, +INF] EQUIVALENCES: { } (0 elements)
Found new range for s_56: [63740, +INF]
Simulating statement (from ssa_edges): s_56 = PHI <_53(3), _12(12)>
Visiting PHI node: s_56 = PHI <_53(3), _12(12)>
Argument #0 (3 -> 4 executable)
_53
Value: UNDEFINED
Argument #1 (12 -> 4 executable)
_12
Value: UNDEFINED
Meeting
UNDEFINED
and
UNDEFINED
to
UNDEFINED
Found new range for s_56: UNDEFINED
Simulating statement (from ssa_edges): s_56 = PHI <_53(3), _12(12)>
Visiting PHI node: s_56 = PHI <_53(3), _12(12)>
Argument #0 (3 -> 4 executable)
_53
Value: [63740, +INF] EQUIVALENCES: { _19 } (1 elements)
Argument #1 (12 -> 4 executable)
_12
Value: UNDEFINED
Meeting
[63740, +INF] EQUIVALENCES: { _19 } (1 elements)
and
UNDEFINED
to
[63740, +INF] EQUIVALENCES: { } (0 elements)
Found new range for s_56: [63740, +INF]
which means _53 has bogus transitions:
Visiting statement:
_53 = ASSERT_EXPR <_19, _19 > 63739>;
Intersecting
[63740, +INF] EQUIVALENCES: { _19 } (1 elements)
and
[0, +INF]
to
[63740, +INF] EQUIVALENCES: { _19 } (1 elements)
Found new range for _53: [63740, +INF]
Visiting statement:
_53 = ASSERT_EXPR <_19, _19 > 63739>;
Intersecting
[63740, +INF] EQUIVALENCES: { _19 } (1 elements)
and
[15935, 32767]
to
UNDEFINED
Found new range for _53: UNDEFINED
I have a patch.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/55011] [4.8 Regression] GCC in an infinite loop at -O2 in VRP
2012-10-21 18:31 [Bug middle-end/55011] New: GCC in an infinite loop at -O2 antoine.balestrat at gmail dot com
` (3 preceding siblings ...)
2012-10-22 10:04 ` rguenth at gcc dot gnu.org
@ 2012-10-22 13:27 ` rguenth at gcc dot gnu.org
2012-10-22 13:27 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-22 13:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55011
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-22 13:26:52 UTC ---
Author: rguenth
Date: Mon Oct 22 13:26:48 2012
New Revision: 192689
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192689
Log:
2012-10-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/55011
* tree-vrp.c (update_value_range): For invalid lattice transitions
drop to VARYING.
* gcc.dg/torture/pr55011.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/torture/pr55011.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/55011] [4.8 Regression] GCC in an infinite loop at -O2 in VRP
2012-10-21 18:31 [Bug middle-end/55011] New: GCC in an infinite loop at -O2 antoine.balestrat at gmail dot com
` (4 preceding siblings ...)
2012-10-22 13:27 ` rguenth at gcc dot gnu.org
@ 2012-10-22 13:27 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-22 13:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55011
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-22 13:27:16 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread