https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119808

--- Comment #7 from Zdenek Sojka <zsojka at seznam dot cz> ---
Created attachment 61132
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61132&action=edit
testcase failing even with the patch applied

Thank you for the fix; I have another testcase that cvise fails to reduce
further, it has a lot of unused variables and code. The beef of the testcase
is:


short foo0_u16_0;

void foo0 (_BitInt (8) ub8_0, short s16_0, char *ret)
{
  ub8_0 *= (foo0_u16_0 % (_BitInt (511)) 396150) & s16_0;
  *ret = ub8_0;
}


int
main ()
{
  char x;
  foo0 (5, 4, &x);
  for (unsigned i = 0; i < sizeof (x); i++)
    __builtin_printf ("%02x", i[(volatile unsigned char *) &x]);
}

it should print 00, but it prints:

$ x86_64-pc-linux-gnu-gcc -fwrapv -ftrivial-auto-var-init=zero
-ftree-coalesce-vars testcase2.c
$ ./a.out
14

Reply via email to