[Bug c/31734] optimizer looses ops for with aliasing

2007-04-29 Thread ebotcazou at gcc dot gnu dot org
--- Comment #3 from ebotcazou at gcc dot gnu dot org 2007-04-29 19:58 --- > Given that "A character type may alias any other type.", > I suppose I should be able to use (it works): > > memcpy(&out->fraction, &value, 4); > memcpy(&out->mantissa, 4+(char*)&value, 4); > out->mantissa &= 0

[Bug c/31734] optimizer looses ops for with aliasing

2007-04-29 Thread ajrobb at bigfoot dot com
--- Comment #2 from ajrobb at bigfoot dot com 2007-04-29 19:51 --- Thanks, I'd forgotten that you can only alias through char* (or types related to the operand). Given that "A character type may alias any other type.", I suppose I should be able to use (it works): memcpy(&out->fraction

[Bug c/31734] optimizer looses ops for with aliasing

2007-04-28 Thread ebotcazou at gcc dot gnu dot org
--- Comment #1 from ebotcazou at gcc dot gnu dot org 2007-04-28 16:53 --- > #if 0 > /* abuse union to cast (long double) to int[] - but it works */ > result.value = value; > out->fraction = result.array[0]; > out->mantissa = result.array[1] & 0x7fff; > #else > /* this is o