Due to a backend bug, dbr had picked a delay slot insn for annul-true which was not actually elegible for annul-true. When I fixed the bug, I found that instead an insn from the target path was chosen, the restore of the return address, as the target is an epilogue. The original instruction, mov r4,-1 , would have been suitable as a non-anulled delay slot insn, since r4 is a call-used register, and the function does not return a value that would require r4 to represent, and the epilogue did not make use of the value in r4.
I've seen this for ARC compiling cjpeg/jcmarker.c using the options: -mnorm -mswap -mmul64 -mARC600 -O3 -fomit-frame-pointer in the function write_file_header. For obvious reasons I can't provide preprocessed source for some eighty years. -- Summary: delared branch scheduling doesn't fully take return into account Product: gcc Version: 4.2.1 Status: UNCONFIRMED Keywords: missed-optimization Severity: minor Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: amylaar at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38452