[Bug middle-end/61010] [4.8/4.9/4.10 Regression] Infinite recursion in fold

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 30 10:13:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61010

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Indeed we iterate in /* Canonicalize (X & C1) | C2.  */ because we fold

 (unsigned int) (a * 64) & 255

to

 (unsigned int) (a * 64) & 192

in /* Fold (X * CST1) & CST2 to zero if we can, or drop known zero bits from
CST2.  */


The iterating input is

 ((unsigned int) (a * 64) & 192) | 63

where it seems to fail to "Minimize the number of bits set in C1"
because it hits the "unless" case.

One option is to apply the same "unless" case to the "drop known zero bits"
BIT_AND_EXPR folding.



More information about the Gcc-bugs mailing list