https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104153
Bug ID: 104153 Summary: [12 Regression] ICE due to recent ifcvt changes Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: law at gcc dot gnu.org Target Milestone: --- Created attachment 52249 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52249&action=edit Testcase or1k-elf has started regressing building newlib after this patch: commit aa8cfe785953a0e87d2472311e1260cd98c605c0 (HEAD) Author: Robin Dapp <rd...@linux.ibm.com> Date: Wed Jan 19 17:36:36 2022 +0100 ifcvt: Try re-using CC for conditional moves. Following up on the previous patch, this patch makes noce_convert_multiple emit two cmov sequences: The same one as before and a second one that tries to re-use the existing CC. Then their costs are compared and the cheaper one is selected. gcc/ChangeLog: * ifcvt.cc (cond_exec_get_condition): New parameter to allow getting the reversed comparison. (try_emit_cmove_seq): New function to facilitate creating a cmov sequence. (noce_convert_multiple_sets): Create two sequences and use the less expensive one. It's faulting a bit later in the RTL pipeline, but I think what's going on is we're modifying an insn in-place and don't update the DF information leading to a DF verification failure later. I'd bet if we did a full DF verify after ifcvt we'd see the failure earlier. Compile the attached code with -O2 on an or1k-elf cross-compiler to get: dump file: j.c.276r.cprop3 ../../../../../../..//newlib-cygwin/newlib/libm/math/s_floor.c: In function ‘floor’: ../../../../../../..//newlib-cygwin/newlib/libm/math/s_floor.c:121:1: internal compiler error: in df_refs_verify, at df-scan.cc:4003 0xca95c6 df_refs_verify /home/jlaw/test/gcc/gcc/df-scan.cc:4003 0xca9836 df_insn_refs_verify /home/jlaw/test/gcc/gcc/df-scan.cc:4086 0xca99d7 df_bb_verify /home/jlaw/test/gcc/gcc/df-scan.cc:4119 0xca9fa5 df_scan_verify() /home/jlaw/test/gcc/gcc/df-scan.cc:4240 0xc94512 df_verify() /home/jlaw/test/gcc/gcc/df-core.cc:1818 0xc92e0c df_analyze_1 /home/jlaw/test/gcc/gcc/df-core.cc:1214 0xc931d0 df_analyze() /home/jlaw/test/gcc/gcc/df-core.cc:1290 0x1dc4925 execute_rtl_cprop /home/jlaw/test/gcc/gcc/cprop.cc:1925 0x1dc4a24 execute /home/jlaw/test/gcc/gcc/cprop.cc:1964