https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77937
--- Comment #10 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- It still happens, but on another unit this time: markus@x4 ffmpeg % cat h264dsp.i extern int fn2(int); extern int fn3(int); int a, b, c; void fn1(long p1) { char *d; for (;; d += p1) { d[0] = fn2(1 >> a); fn3(0); fn3(c >> a); d[1] = fn3(d[1] * b + c >> a); d[4] = fn3(d[4] * b + c >> a); d[5] = fn3(d[5] * b + c >> a); } } markus@x4 ffmpeg % gcc -march=amdfam10 -O3 -c -S h264dsp.i h264dsp.i: In function ‘fn1’: h264dsp.i:4:6: internal compiler error: in replace_one_candidate, at gimple-ssa-strength-reduction.c:3369 void fn1(long p1) { ^~~ Simply building ffmpeg with -march=amdfam10 finds these bugs. Please consider reverting your original patch until you come up with solution.