This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
CFG not taken care
- From: Vimal Kumar <askgcc at yahoo dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 10 Dec 2003 02:18:43 -0800 (PST)
- Subject: CFG not taken care
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!!
Thanks and Regards,
=====
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/