public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@redhat.com>
To: Andrew Pinski <pinskia@physics.uc.edu>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix PRs middle-end/15014 and middle-end/16973, removing labels with their address taken
Date: Tue, 05 Oct 2004 22:40:00 -0000	[thread overview]
Message-ID: <1097015702.22266.583.camel@localhost.localdomain> (raw)
In-Reply-To: <2852718A-1614-11D9-81C0-000A95D692F4@physics.uc.edu>

On Mon, 2004-10-04 at 08:46, Andrew Pinski wrote:
> The problem here is that we were getting rid of some bb as they were 
> being marked as unreachable (which is true in the code flow sense) but 
> should not
> be removed.  I fixed this by adding an edge from the first bb to the 
> label's
> bb which has its address taken.  I think this is most correct solution 
> as
> this does not happen much we should not have to worry about losing some
> optimization possibility from doing it this way.
> 
> OK? Bootstrapped and tested on powerpc-apple-darwin.
> 
> Thanks,
> Andrew Pinski
> 
> 
> Testcase:
> void
> f (void)
> {
>    static __SIZE_TYPE__ u = &&a-&&b;
>    a : b :  return;
> }
> 
> 
> ChangeLog:
> 	* tre-cfg.c (make_edges): After making the edges but before
> 	cleaning up the cfg, make an edge from the first BB to ever
> 	BB which we take the address of the label.
Didn't we decide to disallow taking the addresses of user labels
for use by anything but control flow statements?  That would
make this code ill-formed.

If we're going to allow this, then I would strongly recommend
against this approach to the problem.  Instead just move
these labels to the start of their nearest following block that
is reachable.

Inserting arbitrary edges into the CFG is generally bad.

Jeff


  reply	other threads:[~2004-10-05 22:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-04 15:06 Andrew Pinski
2004-10-05 22:40 ` Jeffrey A Law [this message]
2004-10-05 23:12   ` Joseph S. Myers
2004-10-06  2:35   ` Andrew Pinski
2004-10-06 17:03     ` Jeffrey A Law
2004-10-10 18:01   ` Andrew Pinski
2004-10-18 19:27     ` Jeffrey A Law
2004-10-18 20:19       ` Andrew Pinski
2004-10-18 21:37 Ulrich Weigand

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=1097015702.22266.583.camel@localhost.localdomain \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pinskia@physics.uc.edu \
    /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).