This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Irreducible loops in generated code
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: Alain Ketterlin <alain dot ketterlin at gmail dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 20 Aug 2010 01:28:27 +0200
- Subject: Re: Irreducible loops in generated code
- References: <AANLkTikQTXv5=Fs05zYBCC=ASX9aRoqGDqkWh8_z62=6@mail.gmail.com>
Hi,
> > I'm working on decompiling x86-64 binary programs, using branches to rebuild
> > a control-flow graph and looking for loops. I've found a significant number
> > of irreducible loops in gcc-produced code (irreducible loops are loops with
> > more than one entry point), especially in -O3 optimized binaries, even when
> > the source code is "well" structured. My experiments are done mainly on the
> > SPEC CPU-2006 benchmarks.
> >
> > My question is: where do these irreducible loops come from? Which
> > optimization pass leads to irreducible regions? Thanks in advance for any
> > pointer.
>
> Questions right back at you: What compiler version are you using? Got
> a specific exampe (test case)?
>
> In older releases of GCC4, jump threading sometimes resulted in
> irreducible regions, but more recent GCCs carefully try to avoid them.
I am not sure that is actually true. Afaik, we only avoid this on gimple,
while rtl jump threading does not care,
Zdenek