public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "law at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/20460] Nasty extensions that should always warn
Date: Wed, 30 Mar 2005 18:58:00 -0000 [thread overview]
Message-ID: <20050330185758.29826.qmail@sourceware.org> (raw)
In-Reply-To: <20050313183857.20460.tobi@gcc.gnu.org>
------- Additional Comments From law at redhat dot com 2005-03-30 18:57 -------
Subject: Re: [PR tree-optimization/20460] add phi args to dests of
dce-redirected edges
On Wed, 2005-03-30 at 02:56 -0300, Alexandre Oliva wrote:
> When remove_dead_stmt() redirects a control stmt, the edge redirection
> reserves space for the phi arg for the new incoming edge in all phi
> nodes, but, instead of filling them in with information obtained from
> the edge redirection, we simply discard this information. This leaves
> NULL in the phi args, which may cause crashes later on.
>
> This patch fixes the problem by filling in the phi args using the
> PENDING_STMT list created during edge redirection. This appears to be
> the intended use for this information, and it is used similarly in
> e.g. loop unrolling.
>
> Bootstrapping mainline and 4.0 branch on amd64-linux-gnu, and mainline
> on i686-pc-linux-gnu. Ok to install if bootstrap and regtesting pass?
>
> The patch below is for the 4.0 branch, but it applies cleanly and
> correctly in mainline as well, since it's just a few lines off.
/* Redirect the first edge out of BB to reach POST_DOM_BB. */
redirect_edge_and_branch (EDGE_SUCC (bb, 0), post_dom_bb);
- PENDING_STMT (EDGE_SUCC (bb, 0)) = NULL;
+ flush_pending_stmts (EDGE_SUCC (bb, 0));
I'm having trouble seeing how this can be correct.
AFAICT this assumes that EDGE_SUCC (bb, 0)->dest before the redirection
has similar PHI as post_dom_bb and that the PHIs appear in the same
order in both blocks. I'm not sure you can make that assumption.
This code is triggered rarely, I would expect it to be even rarer still
for POST_DOM_BB to have PHI nodes. You could probably just ignore dead
control statements where the post dominator has PHI nodes and I doubt
it would ever be noticed.
Jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20460
next prev parent reply other threads:[~2005-03-30 18:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-13 18:39 [Bug fortran/20460] New: " tobi at gcc dot gnu dot org
2005-03-13 18:44 ` [Bug fortran/20460] " pinskia at gcc dot gnu dot org
2005-03-14 6:34 ` kargl at gcc dot gnu dot org
2005-03-14 10:56 ` tobi at gcc dot gnu dot org
2005-03-30 5:57 ` aoliva at redhat dot com
2005-03-30 18:58 ` law at redhat dot com [this message]
[not found] <bug-20460-8513@http.gcc.gnu.org/bugzilla/>
2006-05-07 16:41 ` fxcoudert at gcc dot gnu dot org
2006-05-07 16:46 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2006-05-07 16:48 ` fxcoudert at gcc dot gnu dot org
2006-05-10 14:59 ` fxcoudert at gcc dot gnu dot org
2006-05-11 21:40 ` fxcoudert at gcc dot gnu dot org
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=20050330185758.29826.qmail@sourceware.org \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@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).