public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Vimal Kumar <askgcc@yahoo.com>
Cc: gcc@gcc.gnu.org
Subject: Re: CFG not taken care
Date: Wed, 10 Dec 2003 11:48:00 -0000	[thread overview]
Message-ID: <20031210112831.GA20302@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20031210101843.83887.qmail@web21504.mail.yahoo.com>

> Hi,
> 
>  I was just going through the GCC code when I happen
> to notice something strange. It may not be bug, but
> I'm confused.
> 
>   Defined in rtlanal.c, the function reg_set_between_p
> returns true if a register is set between two insns;
> all three things passed in its arguments. To my
> surprise, there was just a loop like:
> 
>  for (insn = (NEXT_INSN (from_insn); insn != to_insn;
> insn = NEXT_INSN (insn))
>   {
>     ........
>   }
> 
>  It is called by many passes; but the important point
> is that its traversal is linear. The CFG is not taken
> care of. For example, consider the scenario:
> 
> .L1
> from_insn;
> bra .L2         (unconditional jump)
> 
> .L3
> ......
> to_insn;
> 
> .L2
> .....
> /* set the reg here */
> bra .L2
> 
>   Certainly, these cases cannot be caught by
> reg_set_between_p. There is a whole set of such
> functions like reg_referenced_between_p, etc. Is there
> any other set of functions covering CFG??
> 
>   I may be missing some important observation. Sorry
> for my ignorance!!

These functions are supposed to be used only locally inside superblock
where this don't matter.  We do similar local analysis at many places in
GCC still :(

Honza
> 
> Thanks and Regards,
> 
> 
> =====
> 
> 
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/

  reply	other threads:[~2003-12-10 11:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-10 10:36 Vimal Kumar
2003-12-10 11:48 ` Jan Hubicka [this message]
2003-12-10 12:28   ` Theodore Papadopoulo

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=20031210112831.GA20302@atrey.karlin.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=askgcc@yahoo.com \
    --cc=gcc@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).