Patchwork [lra] Fix rtl checking failure

login
register
mail settings
Submitter Richard Sandiford
Date Oct. 18, 2012, 1:30 p.m.
Message ID <876267di0u.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com>
Download mbox | patch
Permalink /patch/192319/
State New
Headers show

Comments

Richard Sandiford - Oct. 18, 2012, 1:30 p.m.
This is the first of two patches needed to get a clean bootstrap on
x86_64-linux-gnu with RTL checking enabled.  It simply stops us from
pushing notes, barriers, etc. onto the stack, which then trigger a
checking failure when we try to access their patterns later.
Tested on x86_64-linux-gnu.  OK for lra branch?

There are still some extra testsuite failures compared to the default
checking mode:

FAIL: g++.dg/torture/pr49938.C  -O3 -fomit-frame-pointer -funroll-loops  (internal compiler error)
FAIL: g++.dg/torture/pr49938.C  -O3 -fomit-frame-pointer -funroll-loops  (test for excess errors)
FAIL: g++.dg/torture/pr49938.C  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  (internal compiler error)
FAIL: g++.dg/torture/pr49938.C  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  (test for excess errors)

These failures are due to subregs of hard registers appearing in the
insn stream.  Although that in itself is easy to fix, I think there
might be some problems with the way we handle multi-register hard
registers during splitting, e.g. for situations like:

  write (reg:DI 2)
  ...split 2/3 here...
  read (reg:SI 3)
  ...
  read (reg:SI 2)

That probably needs looking at first.

Richard


gcc/
	* lra.c (push_insns): Check INSN_P.

Patch

Index: gcc/lra.c
===================================================================
--- gcc/lra.c	2012-10-17 16:36:34.000000000 +0100
+++ gcc/lra.c	2012-10-18 11:48:40.423088311 +0100
@@ -1810,7 +1810,8 @@  push_insns (rtx from, rtx to)
   if (from == NULL_RTX)
     return;
   for (insn = from; insn != to; insn = PREV_INSN (insn))
-    lra_push_insn (insn);
+    if (INSN_P (insn))
+      lra_push_insn (insn);
 }
 
 /* Emit insns BEFORE before INSN and insns AFTER after INSN.  Put the