https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120313
Bug ID: 120313
Summary: nternal compiler error: in move_for_stack_reg, at
reg-stack.cc:1199 since 4.7.1 using -O3
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: mario.rodriguezb1 at um dot es
Target Milestone: ---
ICE obtain in code. It only crashes with N > 5 and if you remove "assert(a[i]
== b[i]);" compiler returncode is 0:
```
#include <assert.h>
#define N 5
int main (void) {
const float ftab[N] = { 1.0};
float a[N], b[N];
unsigned int i, j;
for (i = 0; i < N; i++) {
for (j = 0; j < N; j++) {
a[j] = ftab[j];
}
for (j = 0; j < N; j++) {
__asm__("fmul add %0, %2, %0\nfmul add %1, %3, %1" :"=f"
(a[j]),"=f" (b[j]) : "f" (b[j]), "f" (a[j]));
}
assert(a[i] == b[i]);
}
return 0;
}
```
To quickly reproduce:
https://godbolt.org/z/xj3zbznW3