-----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 > removes insn where it should not (optim -O2, -O3) > > Here is the code giving me headachs which returns 0 when it should > return 0x3F800000 (hex representation of 1.0f) : > > void f1(int *ret2) { *ret2 = 2; } > > float f2(float par1) { return par1; } > > void (*ff)() = f1; > > int main() { int x; float af; ff(&x); af = f2(1.0f); return *((int > *)(&af)); } > > When I try to simplify this sample code further, the problem > disappear even if apparenlty there is no relation between the f2 > call and the ff call... Is this even valid C code? Aren't you accessing "af" as an int* in the return statement?
jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJO4jMJAAoJEBRtltQi2kC7T1EH+gM5j1U6wQ5R1CTNeq5Ekt54 VWjUKFMHcnJASsYFNH2sCLdpOj9hC7aESJGMuHCC14JFIhJEh7mUkN8Mb5mn0uEV De1okz5DIL/TcdX5Ly/wN92s9utjSL336zzsYzCapnp99otutVhVkuPMaq5PAd7M og++sKzcIrHiXz91SwJfc8GgZitvJGUQ7kh3y8EkYzdDS/dw/XaPfHHsdpXrg8LH O1p1ZNzcx1EbzujBSVi92rqUAIuol5ou9n58BVswoqpMaGRXyr/53cbyVMH3mngr K5E1aaQpbV1e7UNW/oVVLg7qBcX11LQbUCfAKkuId7lxAXoG5w0z/VGjMi4fKMo= =7uts -----END PGP SIGNATURE-----