* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
@ 2010-10-11 21:11 ` pinskia at gcc dot gnu.org
2010-10-11 23:13 ` hjl.tools at gmail dot com
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-11 21:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.6.0
Summary|ice in |[4.6 Regression] ice in
|vect_update_ivs_after_vecto |vect_update_ivs_after_vecto
|rizer |rizer
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
2010-10-11 21:11 ` [Bug tree-optimization/45971] [4.6 Regression] " pinskia at gcc dot gnu.org
@ 2010-10-11 23:13 ` hjl.tools at gmail dot com
2010-10-11 23:17 ` pinskia at gcc dot gnu.org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl.tools at gmail dot com @ 2010-10-11 23:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2010.10.11 23:13:10
CC| |ktietz at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-11 23:13:10 UTC ---
It is caused by revision 159912:
http://gcc.gnu.org/ml/gcc-cvs/2010-05/msg00969.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
2010-10-11 21:11 ` [Bug tree-optimization/45971] [4.6 Regression] " pinskia at gcc dot gnu.org
2010-10-11 23:13 ` hjl.tools at gmail dot com
@ 2010-10-11 23:17 ` pinskia at gcc dot gnu.org
2010-10-12 0:21 ` hjl.tools at gmail dot com
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-11 23:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-11 23:17:20 UTC ---
(In reply to comment #1)
> It is caused by revision 159912:
>
> http://gcc.gnu.org/ml/gcc-cvs/2010-05/msg00969.html
This does not make sense as this is fixing an ICE which would have happened
earlier.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (2 preceding siblings ...)
2010-10-11 23:17 ` pinskia at gcc dot gnu.org
@ 2010-10-12 0:21 ` hjl.tools at gmail dot com
2010-10-12 1:52 ` hjl.tools at gmail dot com
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl.tools at gmail dot com @ 2010-10-12 0:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-12 00:20:58 UTC ---
The bug was introduced between 159879 and 159912.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (3 preceding siblings ...)
2010-10-12 0:21 ` hjl.tools at gmail dot com
@ 2010-10-12 1:52 ` hjl.tools at gmail dot com
2010-10-26 4:03 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: hjl.tools at gmail dot com @ 2010-10-12 1:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|hjl.tools at gmail dot com, |spop at gcc dot gnu.org
|ktietz at gcc dot gnu.org |
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-12 01:52:49 UTC ---
It is caused by revision 159883:
http://gcc.gnu.org/ml/gcc-cvs/2010-05/msg00939.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (4 preceding siblings ...)
2010-10-12 1:52 ` hjl.tools at gmail dot com
@ 2010-10-26 4:03 ` jakub at gcc dot gnu.org
2010-11-04 12:34 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-26 4:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (5 preceding siblings ...)
2010-10-26 4:03 ` jakub at gcc dot gnu.org
@ 2010-11-04 12:34 ` rguenth at gcc dot gnu.org
2010-11-04 13:25 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-04 12:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-04 12:34:43 UTC ---
Reduced testcase:
typedef unsigned long gsize;
typedef int gint;
enum { NUM_LST_DSPOPE = 12 };
struct Preferences {
gint lst_ope_columns[NUM_LST_DSPOPE+1];
};
extern struct Preferences *PREFS;
void
homebank_pref_load(gint *bsrc, gsize length)
{
gint i;
for(i=0; i<NUM_LST_DSPOPE-1 ; i++)
{
PREFS->lst_ope_columns[i] = (bsrc[i] == (!(0))) ? i+1 : -(i+1);
}
}
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (6 preceding siblings ...)
2010-11-04 12:34 ` rguenth at gcc dot gnu.org
@ 2010-11-04 13:25 ` rguenth at gcc dot gnu.org
2010-11-08 8:44 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-04 13:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |matt at use dot net
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-04 13:24:38 UTC ---
*** Bug 46077 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (7 preceding siblings ...)
2010-11-04 13:25 ` rguenth at gcc dot gnu.org
@ 2010-11-08 8:44 ` jakub at gcc dot gnu.org
2010-11-09 9:13 ` irar at il dot ibm.com
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-08 8:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-08 08:43:51 UTC ---
Slightly more reduced testcase:
void
foo (int *x, int *y)
{
int i;
for (i = 0; i < 11; i++)
y[i] = (x[i] == 1) ? i + 1 : -(i + 1);
}
The following:
void
bar (int *x, int *y)
{
int i;
for (i = 0; i < 64; i++)
y[i] = (x[i] == 1) ? i + 1 : -(i + 1);
}
ICEs with
internal compiler error: in get_initial_def_for_induction, at
tree-vect-loop.c:2659
instead.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (8 preceding siblings ...)
2010-11-08 8:44 ` jakub at gcc dot gnu.org
@ 2010-11-09 9:13 ` irar at il dot ibm.com
2010-11-09 20:03 ` spop at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: irar at il dot ibm.com @ 2010-11-09 9:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
Ira Rosen <irar at il dot ibm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |irar at il dot ibm.com
--- Comment #8 from Ira Rosen <irar at il dot ibm.com> 2010-11-09 09:12:43 UTC ---
Looking at this loop:
void
foo (int *x, int *y)
{
int i;
for (i = 0; i < 11; i++)
y[i] = (x[i] == 1) ? i + 1 : -(i + 1);
}
I see that first time that we try to analyze phi i_19 = PHI <prephitmp.8_25(4),
0(2)> (to detect induction), scev analysis succeeds:
(analyze_scalar_evolution
(loop_nb = 1)
(scalar = i_19)
(get_scalar_evolution
(scalar = i_19)
(scalar_evolution = {0, +, 1}_1))
(set_scalar_evolution
instantiated_below = 2
(scalar = i_19)
(scalar_evolution = {0, +, 1}_1))
)
pr45971.c:5: note: Access function of PHI: {0, +, 1}_1
pr45971.c:5: note: step: 1, init: 0
But when we try to check the same phi later (in transformation), evolution
analysis fails:
pr45971.c:5: note: vect_update_ivs_after_vectorizer: phi: i_19 = PHI
<prephitmp.8_25(4), 0(8)>
(analyze_scalar_evolution
(loop_nb = 1)
(scalar = i_19)
(get_scalar_evolution
(scalar = i_19)
(scalar_evolution = ))
(analyze_initial_condition
(loop_phi_node =
i_19 = PHI <prephitmp.8_25(4), 0(8)>
)
(init_cond = 0))
(analyze_evolution_in_loop
(loop_phi_node = i_19 = PHI <prephitmp.8_25(4), 0(8)>
)
(evolution_function = scev_not_known))
(set_scalar_evolution
instantiated_below = 8
(scalar = i_19)
(scalar_evolution = i_19))
)
pr45971.c:5: note: Access function of PHI: i_19
causing ICE.
Here is the code that if-cvt generates:
# i_19 = PHI <prephitmp.8_25(4), 0(2)>
# ivtmp.9_15 = PHI <ivtmp.9_23(4), 11(2)>
D.2688_4 = (long unsigned int) i_19;
D.2689_5 = D.2688_4 * 4;
D.2690_7 = y_6(D) + D.2689_5;
D.2692_11 = x_10(D) + D.2689_5;
D.2693_12 = *D.2692_11;
iftmp.0_13 = i_19 + 1;
D.2707_22 = D.2693_12 == 1;
iftmp.0_14 = ~i_19;
pretmp.7_24 = i_19 + 1;
D.2708_21 = D.2693_12 != 1;
iftmp.0_2 = [cond_expr] D.2693_12 == 1 ? iftmp.0_13 : iftmp.0_14;
prephitmp.8_25 = [cond_expr] D.2693_12 == 1 ? iftmp.0_13 : pretmp.7_24;
*D.2690_7 = iftmp.0_2;
ivtmp.9_23 = ivtmp.9_15 - 1;
if (ivtmp.9_23 != 0)
goto <bb 4>;
else
goto <bb 5>;
prephitmp.8_25 is actually always i_19 + 1, so the second cond_expr is
redundant.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (9 preceding siblings ...)
2010-11-09 9:13 ` irar at il dot ibm.com
@ 2010-11-09 20:03 ` spop at gcc dot gnu.org
2010-11-09 20:05 ` spop at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: spop at gcc dot gnu.org @ 2010-11-09 20:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
Sebastian Pop <spop at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |spop at gcc dot gnu.org
|gnu.org |
--- Comment #9 from Sebastian Pop <spop at gcc dot gnu.org> 2010-11-09 20:03:22 UTC ---
Mine.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (10 preceding siblings ...)
2010-11-09 20:03 ` spop at gcc dot gnu.org
@ 2010-11-09 20:05 ` spop at gcc dot gnu.org
2010-11-10 16:07 ` spop at gcc dot gnu.org
2010-11-10 16:09 ` spop at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: spop at gcc dot gnu.org @ 2010-11-09 20:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
--- Comment #10 from Sebastian Pop <spop at gcc dot gnu.org> 2010-11-09 20:05:13 UTC ---
Created attachment 22353
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22353
patch
The attached patch solves the problem. Not yet tested other than this PR's
testcase.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (11 preceding siblings ...)
2010-11-09 20:05 ` spop at gcc dot gnu.org
@ 2010-11-10 16:07 ` spop at gcc dot gnu.org
2010-11-10 16:09 ` spop at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: spop at gcc dot gnu.org @ 2010-11-10 16:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
--- Comment #11 from Sebastian Pop <spop at gcc dot gnu.org> 2010-11-10 16:06:51 UTC ---
Author: spop
Date: Wed Nov 10 16:06:47 2010
New Revision: 166544
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166544
Log:
Fix PR45971: do not predicate condition phi nodes that are scev analyzable.
2010-11-10 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/45971
* tree-if-conv.c (predicate_scalar_phi): Do not generate a COND_EXPR
for phi nodes analyzable by scev.
* gcc.dg/vect/O3-pr45971.c: New.
Added:
trunk/gcc/testsuite/gcc.dg/vect/O3-pr45971.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-if-conv.c
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/45971] [4.6 Regression] ice in vect_update_ivs_after_vectorizer
2010-10-11 21:10 [Bug c/45971] New: ice in vect_update_ivs_after_vectorizer dcb314 at hotmail dot com
` (12 preceding siblings ...)
2010-11-10 16:07 ` spop at gcc dot gnu.org
@ 2010-11-10 16:09 ` spop at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: spop at gcc dot gnu.org @ 2010-11-10 16:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45971
Sebastian Pop <spop at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #12 from Sebastian Pop <spop at gcc dot gnu.org> 2010-11-10 16:08:23 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 15+ messages in thread