[Bug c++/34295] Bad optimization in an inlined method

2007-11-29 Thread steven at gcc dot gnu dot org
--- Comment #4 from steven at gcc dot gnu dot org 2007-11-29 17:23 --- Try compiling with -fno-strict-aliasing. This is only automatically enabled at -O2 or higher. See the fine manual. I'm not sure what you mean with "more efficient than memcpy". If you mean more efficient as in pro

[Bug c++/34295] Bad optimization in an inlined method

2007-11-29 Thread rguenth at gcc dot gnu dot org
--- Comment #3 from rguenth at gcc dot gnu dot org 2007-11-29 17:21 --- The recommended (and optimized) way to do this is: union { INT64 i; double d; } x; x.d = arg; return x.i; you can also make your way work optimized by specifying -fno-strict-aliasing. That it works without op

[Bug c++/34295] Bad optimization in an inlined method

2007-11-29 Thread dvt at isoft dot fr
--- Comment #2 from dvt at isoft dot fr 2007-11-29 17:09 --- (In reply to comment #1) > You are violating C aliasing rules. Use memcpy (as you did) or a union to > guard > the type punning. > *** This bug has been marked as a duplicate of 21920 *** Are-you sure? Were is the rule that f

[Bug c++/34295] Bad optimization in an inlined method

2007-11-29 Thread rguenth at gcc dot gnu dot org
--- Comment #1 from rguenth at gcc dot gnu dot org 2007-11-29 16:54 --- You are violating C aliasing rules. Use memcpy (as you did) or a union to guard the type punning. *** This bug has been marked as a duplicate of 21920 *** -- rguenth at gcc dot gnu dot org changed: