public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
@ 2011-04-23 7:36 arthur.j.odwyer at gmail dot com
2011-08-19 16:43 ` [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: arthur.j.odwyer at gmail dot com @ 2011-04-23 7:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
Summary: ICE in check_loop_closed_ssa_use() with
"-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: arthur.j.odwyer@gmail.com
Created attachment 24077
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24077
Output of "ajo-gcc -w -O1 -ftree-parallelize-loops=2 -fno-tree-dominator-opts
-c test1942241936.c -v"
This reproduces for me with svn revision 172796 (2011-04-20), but it doesn't
reproduce with gcc-4.5. I'm on Ubuntu 10.10, x86-64. Attached "gcc-v.txt".
cat >test1942241936.c <<EOF
extern int g;
extern void func_48(void);
int func_70(int p) {
int a, b, *ptr = &g;
for (a = 0; a < 10; ++a) {
func_48();
for (b = 0; b < 5; ++b) {
for (g = 0; g < 1; ++g) {
p = 0;
ptr = &p;
}
}
}
*ptr = p;
for (p = 0; p != 10; p += 3u) { }
return g;
}
EOF
gcc -w -O1 -ftree-parallelize-loops=2 -fno-tree-dominator-opts -c
test1942241936.c
test1942241936.c: In function ‘func_70’:
test1942241936.c:3:5: internal compiler error: in check_loop_closed_ssa_use, at
tree-ssa-loop-manip.c:422
This test case is reduced from the output of Csmith
(http://embed.cs.utah.edu/csmith/), using the following command line:
csmith --bitfields --packed-struct -s 1942241936 >test1942241936.c
Notice that the final for-loop has undefined behavior due to signed integer
overflow, which might be putting the compiler in an unfamiliar state... but
surely it shouldn't *crash* the compiler! -fwrapv doesn't make the crash go
away, either.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
@ 2011-08-19 16:43 ` jakub at gcc dot gnu.org
2011-08-19 16:58 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-19 16:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
Target Milestone|--- |4.5.4
Summary|ICE in |[4.5/4.6/4.7 Regression]
|check_loop_closed_ssa_use() |ICE in
|with |check_loop_closed_ssa_use()
|"-ftree-parallelize-loops=2 |with
|-fno-tree-dominator-opts" |"-ftree-parallelize-loops=2
| |-fno-tree-dominator-opts"
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-19 16:38:45 UTC ---
Simplified testcase:
/* PR tree-optimization/48739 */
/* { dg-do compile } */
/* { dg-options "-O1 -ftree-parallelize-loops=2 -fno-tree-dominator-opts" } */
extern int g;
extern void bar (void);
int
foo (int x)
{
int a, b, *c = (int *) 0;
for (a = 0; a < 10; ++a)
{
bar ();
for (b = 0; b < 5; ++b)
{
x = 0;
c = &x;
g = 1;
}
}
*c = x;
for (x = 0; x != 10; x++)
;
return g;
}
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149206
(before that the empty loop would be just removed).
The bug seems to be that parloops pass requests TODO_rebuild_alias which
changes x from TREE_ADDRESSABLE to a gimple var, but we are in loop closed SSA
form at that point and nothing ensures that the optimized variable is put into
loop closed SSA form.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
2011-08-19 16:43 ` [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
@ 2011-08-19 16:58 ` jakub at gcc dot gnu.org
2011-08-19 18:04 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-19 16:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-08-19
Ever Confirmed|0 |1
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-19 16:43:03 UTC ---
If the loop is non-empty, such as containing v[x] = x; and extern int v[10];,
then it started failing with
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145494
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
2011-08-19 16:43 ` [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
2011-08-19 16:58 ` jakub at gcc dot gnu.org
@ 2011-08-19 18:04 ` jakub at gcc dot gnu.org
2011-08-19 23:05 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-19 18:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-19 16:59:00 UTC ---
Created attachment 25055
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25055
gcc47-pr48739.patch
Untested fix.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
` (2 preceding siblings ...)
2011-08-19 18:04 ` jakub at gcc dot gnu.org
@ 2011-08-19 23:05 ` rguenth at gcc dot gnu.org
2011-08-20 7:51 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-08-19 23:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-19 23:04:36 UTC ---
(In reply to comment #1)
> Simplified testcase:
>
> /* PR tree-optimization/48739 */
> /* { dg-do compile } */
> /* { dg-options "-O1 -ftree-parallelize-loops=2 -fno-tree-dominator-opts" } */
>
> extern int g;
> extern void bar (void);
>
> int
> foo (int x)
> {
> int a, b, *c = (int *) 0;
> for (a = 0; a < 10; ++a)
> {
> bar ();
> for (b = 0; b < 5; ++b)
> {
> x = 0;
> c = &x;
> g = 1;
> }
> }
> *c = x;
> for (x = 0; x != 10; x++)
> ;
> return g;
> }
>
> Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149206
> (before that the empty loop would be just removed).
>
> The bug seems to be that parloops pass requests TODO_rebuild_alias which
> changes x from TREE_ADDRESSABLE to a gimple var, but we are in loop closed SSA
> form at that point and nothing ensures that the optimized variable is put into
> loop closed SSA form.
The bug would be that TODO_rebuild_alias does a TODO_update_address_taken.
But really parloops should be re-architected to not require a
TODO_rebuild_alias ... (it isn't required anymore for correctness anyway)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
` (3 preceding siblings ...)
2011-08-19 23:05 ` rguenth at gcc dot gnu.org
@ 2011-08-20 7:51 ` jakub at gcc dot gnu.org
2011-08-20 7:58 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-20 7:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-20 07:48:41 UTC ---
Author: jakub
Date: Sat Aug 20 07:48:35 2011
New Revision: 177924
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177924
Log:
PR tree-optimization/48739
* tree-ssa.c: Include cfgloop.h.
(execute_update_addresses_taken): When updating ssa, if in
loop closed SSA form, call rewrite_into_loop_closed_ssa instead of
update_ssa.
* Makefile.in (tree-ssa.o): Depend on $(CFGLOOP_H).
* gcc.dg/pr48739-1.c: New test.
* gcc.dg/pr48739-2.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/pr48739-1.c
trunk/gcc/testsuite/gcc.dg/pr48739-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/Makefile.in
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
` (4 preceding siblings ...)
2011-08-20 7:51 ` jakub at gcc dot gnu.org
@ 2011-08-20 7:58 ` jakub at gcc dot gnu.org
2011-08-20 8:32 ` [Bug tree-optimization/48739] [4.5 " jakub at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-20 7:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-20 07:51:12 UTC ---
Author: jakub
Date: Sat Aug 20 07:51:09 2011
New Revision: 177925
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177925
Log:
PR tree-optimization/48739
* tree-ssa.c: Include cfgloop.h.
(execute_update_addresses_taken): When updating ssa, if in
loop closed SSA form, call rewrite_into_loop_closed_ssa instead of
update_ssa.
* Makefile.in (tree-ssa.o): Depend on $(CFGLOOP_H).
* gcc.dg/pr48739-1.c: New test.
* gcc.dg/pr48739-2.c: New test.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/pr48739-1.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/pr48739-2.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/Makefile.in
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/tree-ssa.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48739] [4.5 Regression] ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
` (5 preceding siblings ...)
2011-08-20 7:58 ` jakub at gcc dot gnu.org
@ 2011-08-20 8:32 ` jakub at gcc dot gnu.org
2012-06-20 12:59 ` rguenth at gcc dot gnu.org
2012-07-02 9:51 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-20 8:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.5/4.6/4.7 Regression] |[4.5 Regression] ICE in
|ICE in |check_loop_closed_ssa_use()
|check_loop_closed_ssa_use() |with
|with |"-ftree-parallelize-loops=2
|"-ftree-parallelize-loops=2 |-fno-tree-dominator-opts"
|-fno-tree-dominator-opts" |
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-20 07:57:04 UTC ---
Fixed for 4.6+ so far.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48739] [4.5 Regression] ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
` (6 preceding siblings ...)
2011-08-20 8:32 ` [Bug tree-optimization/48739] [4.5 " jakub at gcc dot gnu.org
@ 2012-06-20 12:59 ` rguenth at gcc dot gnu.org
2012-07-02 9:51 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-20 12:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48739] [4.5 Regression] ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts"
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
` (7 preceding siblings ...)
2012-06-20 12:59 ` rguenth at gcc dot gnu.org
@ 2012-07-02 9:51 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 9:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48739
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|4.5.4 |4.6.2
--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 09:51:43 UTC ---
Fixed for 4.6.2.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-07-02 9:51 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-23 7:36 [Bug tree-optimization/48739] New: ICE in check_loop_closed_ssa_use() with "-ftree-parallelize-loops=2 -fno-tree-dominator-opts" arthur.j.odwyer at gmail dot com
2011-08-19 16:43 ` [Bug tree-optimization/48739] [4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
2011-08-19 16:58 ` jakub at gcc dot gnu.org
2011-08-19 18:04 ` jakub at gcc dot gnu.org
2011-08-19 23:05 ` rguenth at gcc dot gnu.org
2011-08-20 7:51 ` jakub at gcc dot gnu.org
2011-08-20 7:58 ` jakub at gcc dot gnu.org
2011-08-20 8:32 ` [Bug tree-optimization/48739] [4.5 " jakub at gcc dot gnu.org
2012-06-20 12:59 ` rguenth at gcc dot gnu.org
2012-07-02 9:51 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).