https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67002
--- Comment #14 from Kazumoto Kojima <kkojima at gcc dot gnu.org> --- Created attachment 36117 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36117&action=edit reduced test case > Michael Karcher, who previously helped smashing some bugs in gcc for the SH > target, had a go at this and he discovered that the difference between stage2 > and stage3 is the -gtoggle switch. I've confirmed it even with cross 5/6 compilers. The above reduced C++ test case fails with "-S -O2 -fcompare-debug" on my 5/6 cross sh4-linux/sh-elf g++. It means that the generated insns differ with/without -g. It looks to me a target independent issue, though I could be wrong about it. With a quick look, rtl_pre pass behaves differently with -g. I've found PRs for -fcompare-debug like 63315, 65874, 65980, 66688 and 67043.