public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty function
@ 2003-05-19 14:51 bangerth
0 siblings, 0 replies; 7+ messages in thread
From: bangerth @ 2003-05-19 14:51 UTC (permalink / raw)
To: bangerth, gcc-bugs, gcc-prs, law, nobody
Synopsis: [tree-ssa] Segfault for (essentially) empty function
Responsible-Changed-From-To: unassigned->law
Responsible-Changed-By: bangerth
Responsible-Changed-When: Mon May 19 14:51:18 2003
Responsible-Changed-Why:
Jeff, you had been doing the tree-ssa C++ stuff, right? Or
is there someone else whom I could bother?
Besides, apart from this one and 10863 (which triggers
_really_ frequent on my code), the tree-ssa branch seems
to be in pretty good shape -- thanks!
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10862
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty function
@ 2003-05-19 22:07 bangerth
0 siblings, 0 replies; 7+ messages in thread
From: bangerth @ 2003-05-19 22:07 UTC (permalink / raw)
To: bangerth, gcc-bugs, gcc-prs, law
Synopsis: [tree-ssa] Segfault for (essentially) empty function
State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon May 19 22:06:49 2003
State-Changed-Why:
Jeff already fixed it. Thanks a lot!
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10862
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty function
@ 2003-05-19 22:06 Wolfgang Bangerth
0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Bangerth @ 2003-05-19 22:06 UTC (permalink / raw)
To: law; +Cc: gcc-prs
The following reply was made to PR optimization/10862; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: law@redhat.com
Cc: gcc-gnats@gcc.gnu.org, <gcc-patches@gcc.gnu.org>
Subject: Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty
function
Date: Mon, 19 May 2003 17:05:02 -0500 (CDT)
> This patch ought to fix this problem.
Yes, it does. Thanks!
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ices.utexas.edu
www: http://www.ices.utexas.edu/~bangerth/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty function
@ 2003-05-19 18:16 law
0 siblings, 0 replies; 7+ messages in thread
From: law @ 2003-05-19 18:16 UTC (permalink / raw)
To: law; +Cc: gcc-prs
The following reply was made to PR optimization/10862; it has been noted by GNATS.
From: law@redhat.com
To: bangerth@dealii.org
Cc: gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty
function
Date: Mon, 19 May 2003 12:12:35 -0600
In message <20030519144341.25098.qmail@sources.redhat.com>, bangerth@dealii.org
writes:
>
>>Number: 10862
>>Category: optimization
>>Synopsis: [tree-ssa] Segfault for (essentially) empty function
>>Confidential: no
>>Severity: serious
>>Priority: medium
>>Responsible: unassigned
>>State: open
>>Class: sw-bug
>>Submitter-Id: net
>>Arrival-Date: Mon May 19 14:46:01 UTC 2003
>>Closed-Date:
>>Last-Modified:
>>Originator: Wolfgang Bangerth
>>Release: unknown-1.0
>>Organization:
>>Environment:
>
>>Description:
>This one's rather funny (and was much simpler to reduce).
>We ICE on a function that's essentially empty:
>---------------------------------------template <int N> void foo () {
> int i;
> switch (i) {
> case 1:
> switch (N) {}
> default: ;
> }
>}
>
>template void foo<1> ();
>---------------------------
>
>g/x> /home/bangerth/bin/gcc-3.4-tree-ssa/bin/c++ -O2 -c a.cc
>a.cc: In function `void foo() [with int N = 1]':
>a.cc:10: instantiated from here
>a.cc:6: internal compiler error: Segmentation fault
>Please submit a full bug report,
>with preprocessed source if appropriate.
>See <URL:http://gcc.gnu.org/bugs.html> for instructions.
This patch ought to fix this problem.
* tree-ssa-dce.c (remove_conditional): If the conditional's block
has no post dominator in the CFG, then wire it to the exit node.
Avoid unnecessary check of bb->succ.
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dce.c,v
retrieving revision 1.1.2.37
diff -c -3 -p -r1.1.2.37 tree-ssa-dce.c
*** tree-ssa-dce.c 16 May 2003 18:09:19 -0000 1.1.2.37
--- tree-ssa-dce.c 19 May 2003 16:50:25 -0000
*************** remove_conditional (basic_block bb)
*** 627,632 ****
--- 627,637 ----
if (bb->succ)
return;
+ /* If there is no post dominator, then this block is going to the
+ exit node. */
+ if (pdom_bb == NULL)
+ pdom_bb = EXIT_BLOCK_PTR;
+
/* If the post dominator has any PHI nodes in it at all, the
conditional has been marked as necessary. This means no PHI
node updating is required. If there are any PHI nodes, its a bug
*************** remove_conditional (basic_block bb)
*** 642,647 ****
#endif
/* Add an edge to BB's post dominator. */
! if (bb->succ == NULL)
! make_edge (bb, pdom_bb, EDGE_FALLTHRU);
}
--- 647,651 ----
#endif
/* Add an edge to BB's post dominator. */
! make_edge (bb, pdom_bb, EDGE_FALLTHRU);
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty function
@ 2003-05-19 15:36 Diego Novillo
0 siblings, 0 replies; 7+ messages in thread
From: Diego Novillo @ 2003-05-19 15:36 UTC (permalink / raw)
To: law; +Cc: gcc-prs
The following reply was made to PR optimization/10862; it has been noted by GNATS.
From: Diego Novillo <dnovillo@redhat.com>
To: bangerth@dealii.org, bangerth@dealii.org, gcc-bugs@gcc.gnu.org,
gcc-prs@gcc.gnu.org, law@gcc.gnu.org, nobody@gcc.gnu.org,
"gcc-gnats@gcc.gnu.org" <gcc-gnats@gcc.gnu.org>
Cc:
Subject: Re: optimization/10862: [tree-ssa] Segfault for (essentially)
empty function
Date: 19 May 2003 11:27:21 -0400
On Mon, 2003-05-19 at 10:51, bangerth@dealii.org wrote:
> Synopsis: [tree-ssa] Segfault for (essentially) empty function
>
> Responsible-Changed-From-To: unassigned->law
> Responsible-Changed-By: bangerth
> Responsible-Changed-When: Mon May 19 14:51:18 2003
> Responsible-Changed-Why:
> Jeff, you had been doing the tree-ssa C++ stuff, right? Or
> is there someone else whom I could bother?
>
It's not actually a C++ problem. It was a bug in DCE when removing a
conditional that had no basic blocks after it.
> Besides, apart from this one and 10863 (which triggers
> _really_ frequent on my code), the tree-ssa branch seems
> to be in pretty good shape -- thanks!
>
I'm glad to hear that. Thanks for testing!
Diego.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty function
@ 2003-05-19 15:16 Diego Novillo
0 siblings, 0 replies; 7+ messages in thread
From: Diego Novillo @ 2003-05-19 15:16 UTC (permalink / raw)
To: law; +Cc: gcc-prs
The following reply was made to PR optimization/10862; it has been noted by GNATS.
From: Diego Novillo <dnovillo@redhat.com>
To: bangerth@dealii.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty function
Date: Mon, 19 May 2003 11:14:47 -0400
On Mon, May 19, 2003 at 02:43:41PM -0000, bangerth@dealii.org wrote:
>
> >Number: 10862
> >Category: optimization
> >Synopsis: [tree-ssa] Segfault for (essentially) empty function
> >Confidential: no
> >Severity: serious
> >Priority: medium
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Mon May 19 14:46:01 UTC 2003
> >Closed-Date:
> >Last-Modified:
> >Originator: Wolfgang Bangerth
> >Release: unknown-1.0
> >Organization:
> >Environment:
>
> >Description:
> This one's rather funny (and was much simpler to reduce).
> We ICE on a function that's essentially empty:
> ---------------------------------------template <int N> void foo () {
> int i;
> switch (i) {
> case 1:
> switch (N) {}
> default: ;
> }
> }
>
> template void foo<1> ();
> ---------------------------
>
When removing blocks with empty conditionals, we should not
assume that the block has a post dominator. I'm testing this
patch.
Diego.
* tree-ssa-dce.c (remove_conditional): Don't assume that the block
to remove has a post-dominator.
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dce.c,v
retrieving revision 1.1.2.37
diff -d -u -p -r1.1.2.37 tree-ssa-dce.c
--- tree-ssa-dce.c 16 May 2003 18:09:19 -0000 1.1.2.37
+++ tree-ssa-dce.c 19 May 2003 15:11:18 -0000
@@ -633,15 +633,16 @@ remove_conditional (basic_block bb)
in DCE. */
#ifdef ENABLE_CHECKING
- {
- tree phi;
- for (phi = phi_nodes (pdom_bb); phi; phi = TREE_CHAIN (phi))
- if (necessary_p (phi))
- abort ();
- }
+ if (pdom_bb)
+ {
+ tree phi;
+ for (phi = phi_nodes (pdom_bb); phi; phi = TREE_CHAIN (phi))
+ if (necessary_p (phi))
+ abort ();
+ }
#endif
/* Add an edge to BB's post dominator. */
if (bb->succ == NULL)
- make_edge (bb, pdom_bb, EDGE_FALLTHRU);
+ make_edge (bb, pdom_bb ? pdom_bb : EXIT_BLOCK_PTR, EDGE_FALLTHRU);
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* optimization/10862: [tree-ssa] Segfault for (essentially) empty function
@ 2003-05-19 14:46 bangerth
0 siblings, 0 replies; 7+ messages in thread
From: bangerth @ 2003-05-19 14:46 UTC (permalink / raw)
To: gcc-gnats
>Number: 10862
>Category: optimization
>Synopsis: [tree-ssa] Segfault for (essentially) empty function
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon May 19 14:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
>Description:
This one's rather funny (and was much simpler to reduce).
We ICE on a function that's essentially empty:
---------------------------------------template <int N> void foo () {
int i;
switch (i) {
case 1:
switch (N) {}
default: ;
}
}
template void foo<1> ();
---------------------------
g/x> /home/bangerth/bin/gcc-3.4-tree-ssa/bin/c++ -O2 -c a.cc
a.cc: In function `void foo() [with int N = 1]':
a.cc:10: instantiated from here
a.cc:6: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
g/x> /home/bangerth/bin/gcc-3.4-tree-ssa/bin/c++ -v
Reading specs from /home/bangerth/bin/gcc-3.4-tree-ssa/lib/gcc-lib/i686-pc-linux-gnu/3.5-tree-ssa/specs
Configured with: ../gcc-3.4-CVS-tree-ssa/configure --enable-checking --enable-languages=c,c++,f77 --prefix=/home/bangerth/bin/gcc-3.4-tree-ssa
Thread model: posix
gcc version 3.5-tree-ssa 20030516 (merged 20030511)
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-05-19 22:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-19 14:51 optimization/10862: [tree-ssa] Segfault for (essentially) empty function bangerth
-- strict thread matches above, loose matches on Subject: below --
2003-05-19 22:07 bangerth
2003-05-19 22:06 Wolfgang Bangerth
2003-05-19 18:16 law
2003-05-19 15:36 Diego Novillo
2003-05-19 15:16 Diego Novillo
2003-05-19 14:46 bangerth
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).