Re: dse2 remove wrong insn

2011-12-12 Thread Andrew Haley
On 12/12/2011 01:48 PM, BELBACHIR Selim wrote: > Everything seems good when I use a union instead of "*((int *)(&af))". > > But I think that "*((int *)(&af))" is a valid syntax to get the > integer representation of my floating point value (in my test case > 0x3F80 for 1.0f in IEEE-754). It ma

Re: dse2 remove wrong insn

2011-12-12 Thread Michael Haubenwallner
On 12/12/11 14:48, BELBACHIR Selim wrote: > Everything seems good when I use a union instead of "*((int *)(&af))". This casting variant rings a bell here, especially when it breaks with optimization but works as union: Does it make a difference when you compile with "-fno-strict-aliasing" ? /ha

Re: dse2 remove wrong insn

2011-12-12 Thread Richard Guenther
I don't know ... > > Selim > > > -Message d'origine- > De : gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] De la part de > Andrew Haley > Envoyé : vendredi 9 décembre 2011 18:37 > À : gcc@gcc.gnu.org > Objet : Re: dse2 remove wrong insn > >

RE: dse2 remove wrong insn

2011-12-12 Thread BELBACHIR Selim
mb ? I don't know ... Selim -Message d'origine- De : gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] De la part de Andrew Haley Envoyé : vendredi 9 décembre 2011 18:37 À : gcc@gcc.gnu.org Objet : Re: dse2 remove wrong insn On 12/09/2011 03:05 PM, BELBACHIR Selim wrote: &

Re: dse2 remove wrong insn

2011-12-09 Thread Andrew Haley
On 12/09/2011 03:05 PM, BELBACHIR Selim wrote: > int main() { > int x; > float af; > ff(&x); > af = f2(1.0f); > return *((int *)(&af)); > } Please try this again, but with a union rather than a pointer cast. I don't think this code is legal C. Andrew.

Re: dse2 remove wrong insn

2011-12-09 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/09/11 08:05, BELBACHIR Selim wrote: > Hi, > > I'm still working on a new gcc-4.5.2 backend for a private > processor. I encountered a strange behavior and I'm unable to find > what causes this behavior. As an overview, it seems that dse2 pass >

Re: dse2 remove wrong insn

2011-12-09 Thread Georg-Johann Lay
BELBACHIR Selim wrote: > Hi, > > I'm still working on a new gcc-4.5.2 backend for a private processor. > I encountered a strange behavior and I'm unable to find what causes this > behavior. > As an overview, it seems that dse2 pass removes insn where it should not > (optim -O2, -O3) > > Here is

dse2 remove wrong insn

2011-12-09 Thread BELBACHIR Selim
Hi, I'm still working on a new gcc-4.5.2 backend for a private processor. I encountered a strange behavior and I'm unable to find what causes this behavior. As an overview, it seems that dse2 pass removes insn where it should not (optim -O2, -O3) Here is the code giving me headachs which return