https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65618
James Cowgill <james410 at cowgill dot org.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rdsandiford at googlemail dot com --- Comment #8 from James Cowgill <james410 at cowgill dot org.uk> --- Please can this be reassigned to component "rtl-optimization". After spending ages investigating this, I now have a fix for it. The underlying bug is in gcc/emit-rtl.c:try_split and is a result of the fix for PR rtl-optimization/48826. In that PR, if a call_insn is split into two instructions, the following NOTE_INSN_CALL_ARG_LOCATION is moved so that it immediately follows the new call_insn. However, after doing that the "after" variable was not updated and it could still point to the old note instruction (the instruction "after" the instruction to be split). The "after" variable is later used to obtain the last instruction in the split and is then passed back to the delayed branch scheduler influencing how delay slots are assigned. My patch adjusts the code which handles the NOTE_INSN_CALL_ARG_LOCATION note so that "after" is updated if necessary. This explains the symptoms of this bug because the NOTE_INSN_CALL_ARG_LOCATION note is only generated if debug information is turned on.