http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56899
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-10
08:05:52 UTC ---
Better testcase:
__attribute__((noinline, noclone)) void
foo (int v)
{
int x = -214748365 * (v - 1);
if (x != -1932735285)
__builtin_abort ();
}
int
main ()
{
foo (10);
return 0;
}
This doesn't really look like an expansion issue, but folder issue, introduced
in between r152207 and r152360 (going to bisect it now).
The good *.original dump is:
int x = (1 - v) * 214748365;
if (x != -1932735285)
while bad is:
int x = v * -214748365 + 214748365;
if (x != -1932735285)
If we want to do this, we'd need to perform the addition in unsigned type
instead of signed.