It looks like gcc sometimes produces "useless" conditional branches.
I've found code like this:
xor%edx,%edx
; code with no effect on edx (see full code below)
test %edx,%edx
jne
The branch on the last line is never taken. Why does gcc generate such
code sequences? Is this pat
Andrew Haley wrote:
On 03/02/2010 08:55 AM, Alain Ketterlin wrote:
It looks like gcc sometimes produces "useless" conditional branches.
I've found code like this:
xor%edx,%edx
; code with no effect on edx (see full code below)
test %edx,%edx
jne
The branch o
I've reported here recently about gcc producing conditional branches
with static outcome. I've finally managed to produce a simple
self-contained example. Here it is:
int f()
{
static int LSW=-1;
double x=0.987654321;
unsigned char ix = *((char *)&x);
if(ix==0xdd || ix==0x3f)
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
On 18/08/2010 12:37, Steven Bosscher wrote:
On Wed, Aug 18, 2010 at 11:53 AM, Alain Ketterlin
wrote:
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
When compiling at -O2 and -O3 optimization, I've found several instances
of routines ending with:
retq
jmp
with no branch pointing to the jmp instruction. Is there any specific
reason for such code? Is there a way to avoid this?
This is gcc 4.4.5, as installed on Ubuntu 10.10, compiling t