view gcc/testsuite/gcc.c-torture/compile/pr50380.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

__attribute__ ((__noreturn__)) extern void fail (void);

char x;

/* This used to get stuck in an infinite loop in find_comparison_args
   when compiling this function for MIPS at -O2.  */

void foo (const unsigned char y)
{
   ((void) (__builtin_expect((!! y == y), 1) ? 0 : (fail (), 0)));
   x = ! y;
}

/* This used to similarly get stuck when compiling for PowerPC at -O2.  */

int foo2 (int arg)
{
  if (arg != !arg)
    fail ();
  if (arg)
    fail ();
}