[Bug tree-optimization/46309] optimization a==3||a==1
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 30 20:28:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46309
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-09-30 20:18:59 UTC ---
Well, the original issue isn't fully fixed. If the gimplifier decides to split
the conditions into multiple basic blocks, i.e. if it isn't
tmp1 = a == 1;
tmp2 = a == 3;
tmp3 = a == 4;
tmp4 = a == 2;
tmp5 = tmp1 | tmp2;
tmp6 = tmp5 | tmp3;
x = tmp6 | tmp4;
but instead
if (a == 1)
goto <bb X>;
if (a == 3)
goto <bb X>;
if (a == 4)
goto <bb X>;
if (a == 2)
goto <bb X>;
x = 0;
goto <bb Y>;
X:
x = 1;
or similar (e.g. two comparisons BIT_IOR_EXPRed together, then jump), then this
optimization isn't performed.
More information about the Gcc-bugs
mailing list