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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-reduction             |

--- Comment #25 from Martin Liška <marxin at gcc dot gnu.org> ---
Ok, using the following reduction script:
https://github.com/marxin/gcc-util/blob/master/bisect/reduce-csmith.sh

I was able to get to:

$ cat pr109031.c
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;

uint32_t crc32_context, g_50;
char transparent_crc_vname;
uint8_t g_44;

void crc32_byte(uint8_t b) { crc32_context = b; }

int main() {
  g_50 = 0;
  uint32_t *l_1155 = &g_50;
  uint8_t *l_1162 = &g_44;
lbl_1206:
  (*l_1155)++, (*l_1162)--;
  if (g_44)
    goto lbl_1206;
  crc32_byte(g_50 >> 8);
  uint32_t r = crc32_context ^ 5UL;
  __builtin_printf("...checksum after hashing %u\n", r);
  if (r != 4)
    __builtin_abort();
  return 0;
}

$ gcc -O2 pr109031.c && ./a.out
...checksum after hashing 5
Aborted (core dumped)
$ gcc-12 -O2 pr109031.c && ./a.out
...checksum after hashing 4
$ gcc pr109031.c && ./a.out
...checksum after hashing 4

Reply via email to