Re: reverse conditionnal jump

2012-01-06 Thread Zdenek Dvorak
Hi, > I'm still developping a new private target backend (gcc4.5.2) and I noticed > something strange in the assembler generated for conditionnal jump. > > > The compiled C code source is : > > void funct (int c) { > int a; > a = 7; > if (c < 0) > a = 4; > return a; > } >

Re: reverse conditionnal jump

2012-01-05 Thread Georg-Johann Lay
BELBACHIR Selim schrieb: Hi, I'm still developping a new private target backend (gcc4.5.2) and I noticed something strange in the assembler generated for conditionnal jump. Maybe unfortunate defnition of branch costs or rtx costs? How can I tell GCC to perform the best conditionnal jump by s

Re: reverse conditionnal jump

2012-01-05 Thread Oleg Endo
On Thu, 2012-01-05 at 14:49 +0100, BELBACHIR Selim wrote: > Hi, > > I'm still developping a new private target backend (gcc4.5.2) and I > noticed something strange in the assembler generated for conditionnal > jump. > > I'm not sure whether it can help you in this particular case, but you might

Re: reverse conditionnal jump

2012-01-05 Thread Ian Lance Taylor
BELBACHIR Selim writes: > How can I tell GCC to perform the best conditionnal jump by sometimes > reversing the comparison ? It should work when compiling with -O2. I can't think of anything you are doing wrong or anything special you should need to do. I think you will need to debug this. S

reverse conditionnal jump

2012-01-05 Thread BELBACHIR Selim
Hi, I'm still developping a new private target backend (gcc4.5.2) and I noticed something strange in the assembler generated for conditionnal jump. The compiled C code source is : void funct (int c) { int a; a = 7; if (c < 0) a = 4; return a; } The assembler generated i