public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Diego Novillo <dnovillo@redhat.com>
To: law@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: optimization/10862: [tree-ssa] Segfault for (essentially) empty function
Date: Mon, 19 May 2003 15:16:00 -0000 [thread overview]
Message-ID: <20030519151601.16409.qmail@sources.redhat.com> (raw)
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);
}
next reply other threads:[~2003-05-19 15:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-19 15:16 Diego Novillo [this message]
-- 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 14:51 bangerth
2003-05-19 14:46 bangerth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030519151601.16409.qmail@sources.redhat.com \
--to=dnovillo@redhat.com \
--cc=gcc-prs@gcc.gnu.org \
--cc=law@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).