* [Bug c/17560] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
@ 2004-09-19 16:53 ` kherron+gcc at fmailbox dot com
2004-09-19 16:55 ` kherron+gcc at fmailbox dot com
` (23 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: kherron+gcc at fmailbox dot com @ 2004-09-19 16:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kherron+gcc at fmailbox dot com 2004-09-19 16:53 -------
Created an attachment (id=7172)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7172&action=view)
prdtoa.i
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug c/17560] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
2004-09-19 16:53 ` [Bug c/17560] " kherron+gcc at fmailbox dot com
@ 2004-09-19 16:55 ` kherron+gcc at fmailbox dot com
2004-09-19 19:19 ` [Bug tree-optimization/17560] [4.0 Regression] " pinskia at gcc dot gnu dot org
` (22 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: kherron+gcc at fmailbox dot com @ 2004-09-19 16:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kherron+gcc at fmailbox dot com 2004-09-19 16:55 -------
Created an attachment (id=7173)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7173&action=view)
prdtoa.s
This is the assembler produced before the crash.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
2004-09-19 16:53 ` [Bug c/17560] " kherron+gcc at fmailbox dot com
2004-09-19 16:55 ` kherron+gcc at fmailbox dot com
@ 2004-09-19 19:19 ` pinskia at gcc dot gnu dot org
2004-09-20 2:00 ` reichelt at gcc dot gnu dot org
` (21 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-19 19:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-19 19:19 -------
This is a bug in scalar evolution code:
#0 0x004d00e4 in find_var_scev_info (var=0x0) at /Volumes/UFS_Partition/pinskia/src/devel/
speedup/gcc/gcc/tree-scalar-evolution.c:338
#1 0x004d3340 in analyze_scalar_evolution (loop=0x41364940, var=0xaebf54) at /Volumes/
UFS_Partition/pinskia/src/devel/speedup/gcc/gcc/tree-scalar-evolution.c:1913
#2 0x004d2cb8 in interpret_rhs_modify_expr (loop=0x41364940, opnd1=0x9514ec,
type=0x4127f64c) at /Volumes/UFS_Partition/pinskia/src/devel/speedup/gcc/gcc/tree-scalar-
evolution.c:1730
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |spop at gcc dot gnu dot org
Severity|normal |critical
Component|c |tree-optimization
Keywords| |ice-on-valid-code
Summary|Segmentation fault compiling|[4.0 Regression]
|prdtoa.c with -Os |Segmentation fault compiling
| |prdtoa.c with -Os
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (2 preceding siblings ...)
2004-09-19 19:19 ` [Bug tree-optimization/17560] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-09-20 2:00 ` reichelt at gcc dot gnu dot org
2004-09-20 2:02 ` reichelt at gcc dot gnu dot org
` (20 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-09-20 2:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-09-20 02:00 -------
Here's a reduced testcase:
================================
void foo()
{
int i, j;
if (i)
{
i++;
goto L;
}
for (; i-1; )
{
L:
for (j=0; j<i; j++) ;
}
}
================================
Just compile with "gcc -Os" to see the crash.
We seem to run into an infinite loop. The compiler runs out of memory
rather quickly.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |monitored
Last reconfirmed|0000-00-00 00:00:00 |2004-09-20 02:00:53
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (3 preceding siblings ...)
2004-09-20 2:00 ` reichelt at gcc dot gnu dot org
@ 2004-09-20 2:02 ` reichelt at gcc dot gnu dot org
2004-09-20 2:08 ` pinskia at gcc dot gnu dot org
` (19 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-09-20 2:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-09-20 02:02 -------
It's a recent regression. Phils's regression hunter reports:
: Search converges between 2004-09-12-trunk (#538) and 2004-09-14-trunk (#539).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (4 preceding siblings ...)
2004-09-20 2:02 ` reichelt at gcc dot gnu dot org
@ 2004-09-20 2:08 ` pinskia at gcc dot gnu dot org
2004-09-27 21:29 ` pinskia at gcc dot gnu dot org
` (18 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-20 2:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-20 02:08 -------
I should note that is the date when IV-OPTs come into which is what is causing the crash by calling
scalar evolution code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (5 preceding siblings ...)
2004-09-20 2:08 ` pinskia at gcc dot gnu dot org
@ 2004-09-27 21:29 ` pinskia at gcc dot gnu dot org
2004-10-07 18:55 ` reichelt at gcc dot gnu dot org
` (17 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-27 21:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-27 21:29 -------
This is not fixed with the patch for 17520 either.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (6 preceding siblings ...)
2004-09-27 21:29 ` pinskia at gcc dot gnu dot org
@ 2004-10-07 18:55 ` reichelt at gcc dot gnu dot org
2004-10-07 21:31 ` pinskia at gcc dot gnu dot org
` (16 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-07 18:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-07 18:55 -------
*** Bug 17883 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |echristo at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (7 preceding siblings ...)
2004-10-07 18:55 ` reichelt at gcc dot gnu dot org
@ 2004-10-07 21:31 ` pinskia at gcc dot gnu dot org
2004-10-07 22:54 ` pinskia at gcc dot gnu dot org
` (15 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-07 21:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-07 21:31 -------
*** Bug 17607 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |loki at inf dot u-szeged dot
| |hu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Segmentation fault compiling prdtoa.c with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (8 preceding siblings ...)
2004-10-07 21:31 ` pinskia at gcc dot gnu dot org
@ 2004-10-07 22:54 ` pinskia at gcc dot gnu dot org
2004-10-08 1:16 ` [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution " reichelt at gcc dot gnu dot org
` (14 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-07 22:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-07 22:54 -------
*** Bug 17704 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |tobi at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (9 preceding siblings ...)
2004-10-07 22:54 ` pinskia at gcc dot gnu dot org
@ 2004-10-08 1:16 ` reichelt at gcc dot gnu dot org
2004-10-08 3:27 ` pinskia at gcc dot gnu dot org
` (13 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-08 1:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-08 01:16 -------
Jan, your patch
http://gcc.gnu.org/ml/gcc-cvs/2004-09/msg00629.html
seems to be responsible for the regression.
Could you please have a look?
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (10 preceding siblings ...)
2004-10-08 1:16 ` [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution " reichelt at gcc dot gnu dot org
@ 2004-10-08 3:27 ` pinskia at gcc dot gnu dot org
2004-10-08 12:08 ` sebastian dot pop at cri dot ensmp dot fr
` (12 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-08 3:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-08 03:27 -------
Even though Jan's patch introduces the failure, this is a latent bug in the scalar evolution code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (11 preceding siblings ...)
2004-10-08 3:27 ` pinskia at gcc dot gnu dot org
@ 2004-10-08 12:08 ` sebastian dot pop at cri dot ensmp dot fr
2004-10-08 12:39 ` Diego Novillo
2004-10-08 12:16 ` hubicka at ucw dot cz
` (11 subsequent siblings)
24 siblings, 1 reply; 28+ messages in thread
From: sebastian dot pop at cri dot ensmp dot fr @ 2004-10-08 12:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sebastian dot pop at cri dot ensmp dot fr 2004-10-08 12:07 -------
Subject: Re: [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
Here is what the code looks like at the level of my analyzer.
loop_0
{
bb_0 (preds = {bb_-1}, succs = {bb_0bb_0})
{
<bb 0>:
if (i_4 != 0) goto <L0>; else goto <L6>;
}
bb_1 (preds = {bb_0}, succs = {bb_1})
{
<L0>:;
i_7 = i_4 + 1;
}
bb_2 (preds = {bb_5bb_1}, succs = {bb_2})
{
# i_1 = PHI <i_2(5), i_7(1)>;
L:;
goto <bb 4> (<L5>);
}
bb_5 (preds = {bb_0bb_4}, succs = {bb_5bb_5})
{
# i_2 = PHI <i_4(0), i_1(4)>;
<L6>:;
if (i_2 != 1) goto L; else goto <L8>;
}
bb_6 (preds = {bb_5}, succs = {bb_6})
{
<L8>:;
return;
}
loop_1
{
bb_3 (preds = {bb_4}, succs = {bb_3})
{
<L4>:;
j_6 = j_3 + 1;
}
bb_4 (preds = {bb_3bb_2}, succs = {bb_4bb_4})
{
# j_3 = PHI <0(2), j_6(3)>;
<L5>:;
if (j_3 < i_1) goto <L4>; else goto <L6>;
}
}
}
The problem is that we have a cycle "i_1 -> i_2 -> i_1" outside any
loop, and I'm not sure about the semantics of this representation.
By the way, is this a valid SSA form?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-10-08 12:08 ` sebastian dot pop at cri dot ensmp dot fr
@ 2004-10-08 12:39 ` Diego Novillo
0 siblings, 0 replies; 28+ messages in thread
From: Diego Novillo @ 2004-10-08 12:39 UTC (permalink / raw)
To: gcc-bugzilla; +Cc: gcc-bugs
On Fri, 2004-10-08 at 08:07, sebastian dot pop at cri dot ensmp dot fr
wrote:
> The problem is that we have a cycle "i_1 -> i_2 -> i_1" outside any
> loop, and I'm not sure about the semantics of this representation.
> By the way, is this a valid SSA form?
>
It is, but this graph is irreducible. Block #3 is only reachable via a
back edge. Or put it another way, block #4 is the entry block for two
different loops.
Diego.
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (12 preceding siblings ...)
2004-10-08 12:08 ` sebastian dot pop at cri dot ensmp dot fr
@ 2004-10-08 12:16 ` hubicka at ucw dot cz
2004-10-08 12:39 ` dnovillo at redhat dot com
` (10 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: hubicka at ucw dot cz @ 2004-10-08 12:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From hubicka at ucw dot cz 2004-10-08 12:16 -------
Subject: Re: [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
>
> ------- Additional Comments From sebastian dot pop at cri dot ensmp dot fr 2004-10-08 12:07 -------
> Subject: Re: [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
>
> Here is what the code looks like at the level of my analyzer.
>
> loop_0
> {
> bb_0 (preds = {bb_-1}, succs = {bb_0bb_0})
> {
> <bb 0>:
> if (i_4 != 0) goto <L0>; else goto <L6>;
>
> }
> bb_1 (preds = {bb_0}, succs = {bb_1})
> {
> <L0>:;
> i_7 = i_4 + 1;
>
> }
> bb_2 (preds = {bb_5bb_1}, succs = {bb_2})
> {
> # i_1 = PHI <i_2(5), i_7(1)>;
> L:;
> goto <bb 4> (<L5>);
>
> }
> bb_5 (preds = {bb_0bb_4}, succs = {bb_5bb_5})
> {
> # i_2 = PHI <i_4(0), i_1(4)>;
> <L6>:;
> if (i_2 != 1) goto L; else goto <L8>;
>
> }
> bb_6 (preds = {bb_5}, succs = {bb_6})
> {
> <L8>:;
> return;
>
> }
> loop_1
> {
> bb_3 (preds = {bb_4}, succs = {bb_3})
> {
> <L4>:;
> j_6 = j_3 + 1;
>
> }
> bb_4 (preds = {bb_3bb_2}, succs = {bb_4bb_4})
> {
> # j_3 = PHI <0(2), j_6(3)>;
> <L5>:;
> if (j_3 < i_1) goto <L4>; else goto <L6>;
>
> }
> }
> }
>
> The problem is that we have a cycle "i_1 -> i_2 -> i_1" outside any
> loop, and I'm not sure about the semantics of this representation.
> By the way, is this a valid SSA form?
It seems to me that this can definitly happen in the case of irreducible
regions...
Honza
>
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (13 preceding siblings ...)
2004-10-08 12:16 ` hubicka at ucw dot cz
@ 2004-10-08 12:39 ` dnovillo at redhat dot com
2004-10-08 13:03 ` sebastian dot pop at cri dot ensmp dot fr
` (9 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: dnovillo at redhat dot com @ 2004-10-08 12:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at redhat dot com 2004-10-08 12:39 -------
Subject: Re: [4.0 Regression] Infinite
recursion in tree-scalar-evolution with -Os
On Fri, 2004-10-08 at 08:07, sebastian dot pop at cri dot ensmp dot fr
wrote:
> The problem is that we have a cycle "i_1 -> i_2 -> i_1" outside any
> loop, and I'm not sure about the semantics of this representation.
> By the way, is this a valid SSA form?
>
It is, but this graph is irreducible. Block #3 is only reachable via a
back edge. Or put it another way, block #4 is the entry block for two
different loops.
Diego.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (14 preceding siblings ...)
2004-10-08 12:39 ` dnovillo at redhat dot com
@ 2004-10-08 13:03 ` sebastian dot pop at cri dot ensmp dot fr
2004-10-08 13:09 ` Diego Novillo
2004-10-08 13:10 ` dnovillo at redhat dot com
` (8 subsequent siblings)
24 siblings, 1 reply; 28+ messages in thread
From: sebastian dot pop at cri dot ensmp dot fr @ 2004-10-08 13:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sebastian dot pop at cri dot ensmp dot fr 2004-10-08 13:03 -------
Subject: Re: [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
> It seems to me that this can definitly happen in the case of irreducible
> regions...
>
> Honza
Then the following patch solves the problem by avoiding the analysis
of these cycles.
Index: tree-scalar-evolution.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-scalar-evolution.c,v
retrieving revision 2.8
diff -c -c -3 -p -r2.8 tree-scalar-evolution.c
*** tree-scalar-evolution.c 1 Oct 2004 09:05:57 -0000 2.8
--- tree-scalar-evolution.c 8 Oct 2004 12:59:37 -0000
*************** tree chrec_dont_know;
*** 284,289 ****
--- 284,290 ----
tree chrec_known;
static bitmap already_instantiated;
+ static bitmap already_analyzed;
static htab_t scalar_evolution_info;
*************** follow_ssa_edge_in_condition_phi (struct
*** 1398,1403 ****
--- 1399,1409 ----
for (i = 1; i < PHI_NUM_ARGS (condition_phi); i++)
{
+ /* Quickly give up when the evolution of one of the branches is
+ not known. */
+ if (*evolution_of_loop == chrec_dont_know)
+ return true;
+
if (!follow_ssa_edge_in_condition_phi_branch (i, loop, condition_phi,
halting_phi,
&evolution_of_branch,
*************** analyze_scalar_evolution_1 (struct loop
*** 1833,1838 ****
--- 1839,1853 ----
goto set_and_end;
}
+ /* Fail on irreducible CFGs. */
+ if (bitmap_bit_p (already_analyzed, SSA_NAME_VERSION (var)))
+ {
+ res = chrec_dont_know;
+ goto set_and_end;
+ }
+ else
+ bitmap_set_bit (already_analyzed, SSA_NAME_VERSION (var));
+
if (res != chrec_not_analyzed_yet)
{
if (loop != bb->loop_father)
*************** analyze_scalar_evolution_1 (struct loop
*** 1870,1875 ****
--- 1885,1892 ----
set_and_end:
+ bitmap_clear_bit (already_analyzed, SSA_NAME_VERSION (var));
+
/* Keep the symbolic form. */
if (res == chrec_dont_know)
res = var;
*************** scev_initialize (struct loops *loops)
*** 2450,2455 ****
--- 2467,2473 ----
scalar_evolution_info = htab_create (100, hash_scev_info,
eq_scev_info, del_scev_info);
already_instantiated = BITMAP_XMALLOC ();
+ already_analyzed = BITMAP_XMALLOC ();
initialize_scalar_evolutions_analyzer ();
*************** scev_finalize (void)
*** 2545,2549 ****
--- 2563,2568 ----
{
htab_delete (scalar_evolution_info);
BITMAP_XFREE (already_instantiated);
+ BITMAP_XFREE (already_analyzed);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (15 preceding siblings ...)
2004-10-08 13:03 ` sebastian dot pop at cri dot ensmp dot fr
@ 2004-10-08 13:10 ` dnovillo at redhat dot com
2004-10-08 13:22 ` rakdver at gcc dot gnu dot org
` (7 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: dnovillo at redhat dot com @ 2004-10-08 13:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at redhat dot com 2004-10-08 13:09 -------
Subject: Re: [4.0 Regression] Infinite
recursion in tree-scalar-evolution with -Os
On Fri, 2004-10-08 at 09:03, sebastian dot pop at cri dot ensmp dot fr
wrote:
> Then the following patch solves the problem by avoiding the analysis
> of these cycles.
>
You could also try splitting blocks, but if there's a cheaper work
around for 4.0, that'd be safer.
Diego.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (16 preceding siblings ...)
2004-10-08 13:10 ` dnovillo at redhat dot com
@ 2004-10-08 13:22 ` rakdver at gcc dot gnu dot org
2004-10-08 13:49 ` sebastian dot pop at cri dot ensmp dot fr
` (6 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-10-08 13:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rakdver at gcc dot gnu dot org 2004-10-08 13:21 -------
This fix should not be necessary (in fact we had the code like this before, but
I removed it and replaced it by current solution; the problem with is that it
behaves really weird, for example the results are dependent on in which order we
process the variables) -- we check for irreducible regions in scev already.
Could you check whether the edges are marked as irreducible? If not, this would
be the problem.
Zdenek
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (17 preceding siblings ...)
2004-10-08 13:22 ` rakdver at gcc dot gnu dot org
@ 2004-10-08 13:49 ` sebastian dot pop at cri dot ensmp dot fr
2004-10-08 20:17 ` rakdver at gcc dot gnu dot org
` (5 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: sebastian dot pop at cri dot ensmp dot fr @ 2004-10-08 13:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sebastian dot pop at cri dot ensmp dot fr 2004-10-08 13:49 -------
Subject: Re: [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
> Could you check whether the edges are marked as irreducible? If not, this would
> be the problem.
>
Indeed, both edges for the phi "i_2 = phi (i_4, i_1)" are not marked
by EDGE_IRREDUCIBLE_LOOP, and consequently backedge_phi_arg_p returns
always false. Same for the first edge i_1 -> i_2 of "i_1 = phi (i_2,
i_7)" that is not marked as EDGE_IRREDUCIBLE_LOOP.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (18 preceding siblings ...)
2004-10-08 13:49 ` sebastian dot pop at cri dot ensmp dot fr
@ 2004-10-08 20:17 ` rakdver at gcc dot gnu dot org
2004-10-09 8:00 ` rakdver at gcc dot gnu dot org
` (4 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-10-08 20:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rakdver at gcc dot gnu dot org 2004-10-08 20:17 -------
Then this should be the proper fix. I will commit it as obvious once it
passes regtesting.
Index: predict.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/predict.c,v
retrieving revision 1.128
diff -c -3 -p -r1.128 predict.c
*** predict.c 28 Sep 2004 07:59:48 -0000 1.128
--- predict.c 8 Oct 2004 20:15:44 -0000
*************** tree_estimate_probability (void)
*** 1300,1305 ****
--- 1300,1306 ----
tree_bb_level_predictions ();
+ mark_irreducible_loops (&loops_info);
predict_loops (&loops_info, false);
FOR_EACH_BB (bb)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (19 preceding siblings ...)
2004-10-08 20:17 ` rakdver at gcc dot gnu dot org
@ 2004-10-09 8:00 ` rakdver at gcc dot gnu dot org
2004-10-11 10:28 ` reichelt at gcc dot gnu dot org
` (3 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-10-09 8:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rakdver at gcc dot gnu dot org 2004-10-09 08:00 -------
Patch:
http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00810.html
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (20 preceding siblings ...)
2004-10-09 8:00 ` rakdver at gcc dot gnu dot org
@ 2004-10-11 10:28 ` reichelt at gcc dot gnu dot org
2004-10-16 16:45 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
24 siblings, 0 replies; 28+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-11 10:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-11 10:28 -------
*** Bug 17928 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |bryner at brianryner dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (21 preceding siblings ...)
2004-10-11 10:28 ` reichelt at gcc dot gnu dot org
@ 2004-10-16 16:45 ` cvs-commit at gcc dot gnu dot org
2004-10-16 16:46 ` rakdver at gcc dot gnu dot org
2004-10-17 19:16 ` reichelt at gcc dot gnu dot org
24 siblings, 0 replies; 28+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-16 16:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-10-16 16:45 -------
Subject: Bug 17560
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: rakdver@gcc.gnu.org 2004-10-16 16:45:38
Modified files:
gcc : ChangeLog predict.c
Log message:
PR tree-optimization/17560
* predict.c (tree_estimate_probability): Mark irreducible
loops.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5905&r2=2.5906
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/predict.c.diff?cvsroot=gcc&r1=1.128&r2=1.129
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (22 preceding siblings ...)
2004-10-16 16:45 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-16 16:46 ` rakdver at gcc dot gnu dot org
2004-10-17 19:16 ` reichelt at gcc dot gnu dot org
24 siblings, 0 replies; 28+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-10-16 16:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rakdver at gcc dot gnu dot org 2004-10-16 16:46 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug tree-optimization/17560] [4.0 Regression] Infinite recursion in tree-scalar-evolution with -Os
2004-09-19 16:52 [Bug c/17560] New: Segmentation fault compiling prdtoa.c with -Os kherron+gcc at fmailbox dot com
` (23 preceding siblings ...)
2004-10-16 16:46 ` rakdver at gcc dot gnu dot org
@ 2004-10-17 19:16 ` reichelt at gcc dot gnu dot org
24 siblings, 0 replies; 28+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-17 19:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-17 19:16 -------
*** Bug 17552 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn|17552 |
CC| |jakub at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17560
^ permalink raw reply [flat|nested] 28+ messages in thread