This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Coalescing/killing redundant labels?
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: gcc at gcc dot gnu dot org
- Date: 17 Jul 2003 01:01:39 +0200
- Subject: [tree-ssa] Coalescing/killing redundant labels?
Consider this snippet:
int a, b;
void
foo (void)
{
if (a)
{ a = b; goto byebye2; }
else if (b)
{ b = a; uselesspos: goto byebye1; }
byebye2:
byebye1:
return;
}
At -O2 we tree-optimize this to:
;; Function foo (foo)
foo ()
{
void byebye2 = <<< error >>>;
void byebye1 = <<< error >>>;
if (a != 0)
{
a = b
}
else
{
if (b != 0)
{
b = a;
uselesspos:;;
goto byebye1;
}
};
byebye2:;;
byebye1:;;
return;
}
So the presence of byebye2 apparently prevents the elimination of the
`goto' statement. Why aren't the byebyex labels coasesced? And what
about the unused label `uselesspos'? It doesn't matter much for the
generated code I suppose, but it gives the expanders just a little less
cruft to deal with, and also for the future post-ssa optimizers... So
maybe it's worth it anyway. Has anyone tried it already??
Gr.
Steven