http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52175
Bug #: 52175 Summary: [4.7 regression] ICE in maybe_record_trace_start after invalid dbr_schedule transformation Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: rsand...@gcc.gnu.org Created attachment 26618 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26618 Testcase The attached testcase fails on MIPS targets (e.g. mipsisa64-elf and mips64-linux-gnu) when compiled with -O2 -g: foo.c: In function ‘foo’: foo.c:25:1: internal compiler error: in maybe_record_trace_start, at dwarf2cfi.c:2231 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. The problem is that dbr_schedule is applying its PLUS/MINUS optimisation to a stack adjustment: that is, it fills a delay slot with a stack adjustment that is only valid on one edge, then inserts the opposite adjustment on the other edge. This is related to PR51471. We shouldn't do this adjustment for frame-related instructions.