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

--- Comment #8 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Executable testcase suitable for bisecting, aborts with -O2 -m32

__attribute__((weak))
int f(long long x[])
{
    int o=0, i;
    for (i=0; i<3; i++) {
        register int a asm("eax");
        a = x[0] / x[1];
        asm("add %1, %0" : "+r"(o) : "r"(a));
        asm("xor %%eax, %%eax" ::: "eax");
    }
    return o;
}

int main()
{
    long long x[] = {1, 1};
    if (f(x) != 3)
        __builtin_abort();
    return 0;
}

Reply via email to