[Bug c/48812] optimizing integer power of 2

2011-04-29 Thread castet.matthieu at free dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48812 --- Comment #2 from Matthieu CASTET 2011-04-29 19:18:43 UTC --- > We also have to make sure the shift count does not get negative, which we can't in this case. Thus (1U<<(b-2)) is not equivalent to (1U<> (b-2)) But I agree it is not trivial opt

[Bug c/48812] optimizing integer power of 2

2011-04-29 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48812 --- Comment #1 from Richard Guenther 2011-04-29 09:43:16 UTC --- We do not exploit the fact that shifts bigger than the width of the type are undefined (in fact we even try to preserve the fact that some CPUs truncate the shift count when constan