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

--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
This is version that does not need -fnon-call-exceptions
If called test (NULL, 0) it should be indefinitely increasing val rather then
segfaulting.  Seems clang gets this one right.

int array[10000];
volatile int val;
int test(short *b,int s)
{
        for (int i = 0; i<10000;i++)
          {
            for (int j = 0; j < 10; j+=s)
                    val++;
            array[i]+=*b;
          }
}

Reply via email to