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

--- Comment #11 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
gcc.dg/torture/pr116488.c fails on avr.

/* { dg-do run } */
/* { dg-additional-options "-fno-forward-propagate" } */
int a, b;
signed char c, e;
unsigned char d;
__attribute__ ((noinline,noclone,noipa))
void f(int g, short h) {
  for (; a < 2; a++) {
    b = h >> 16;
    e = b * h;
    d = h;
    h = c = d % g;
  }
}
int main()
{ 
  f(129, 128); 
  if (b != -1)
    __builtin_abort ();
}

1) There is short h >> 16 which is UB when short is a 16-bit type and int is a
16-bit type ?

2) int may be a 16-bit type, so maybe int a, b should be __INT32_TYPE__ or the
test should dg-require-int32-plus or similar.

Reply via email to