[Bug target/60851] [4.9/5 Regression] ICE: in extract_constrain_insn_cached, at recog.c:2117 with -flive-range-shrinkage -mdispatch-scheduler -march=bdver4

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 18 15:03:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60851

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
I have a patch in testing:

--cut here--
Index: recog.c
===================================================================
--- recog.c     (revision 221482)
+++ recog.c     (working copy)
@@ -2775,6 +2775,10 @@ constrain_operands (int strict, alternative_mask a
                               /* Before reload, accept what reload can turn
                                  into mem.  */
                               || (strict < 0 && CONSTANT_P (op))
+                              /* Before reload, accept a pseudo,
+                                 since LRA can turn it into mem.  */
+                              || (targetm.lra_p () && strict < 0 && REG_P (op)
+                                  && REGNO (op) >= FIRST_PSEUDO_REGISTER)
                               /* During reload, accept a pseudo  */
                               || (reload_in_progress && REG_P (op)
                                   && REGNO (op) >= FIRST_PSEUDO_REGISTER)))
--cut here--

The patch activates "safety net" recognition of pseudo regs for LRA-enabled
targets. LRA is able to spill pseudos to memory to satisfy memory-only
constraints, so constrain_operands should recognize this functionality.

This is actually the same approach as how constants are handled a couple of
lines above.


More information about the Gcc-bugs mailing list