]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/43475 (ICE in form_sum, at reload.c:5348)
authorMichael Matz <matz@suse.de>
Mon, 22 Mar 2010 16:28:51 +0000 (16:28 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Mon, 22 Mar 2010 16:28:51 +0000 (16:28 +0000)
PR middle-end/43475
* recog.c (validate_replace_rtx_group): Replace also in
REG_EQUAL and REG_EQUIV notes.

testsuite/
* gfortran.dg/pr43475.f90: New testcase.

From-SVN: r157640

gcc/ChangeLog
gcc/recog.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr43475.f90 [new file with mode: 0644]

index 5cff766695d5bcd858c84bb8ed5e536a55991e08..6b87dd11d8c94a4d8d96d126e8ec4a27ba4f803d 100644 (file)
@@ -1,3 +1,9 @@
+2010-03-22  Michael Matz  <matz@suse.de>
+
+       PR middle-end/43475
+       * recog.c (validate_replace_rtx_group): Replace also in
+       REG_EQUAL and REG_EQUIV notes.
+
 2010-03-22  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/43390
index 810270625a26c6c2a650b48fecbd58be03cc71a1..bc0b2782d386491687c8471bd404db09218cc4bc 100644 (file)
@@ -787,12 +787,18 @@ validate_replace_rtx_part_nosimplify (rtx from, rtx to, rtx *where,
 
 }
 
-/* Try replacing every occurrence of FROM in INSN with TO.  */
+/* Try replacing every occurrence of FROM in INSN with TO.  This also
+   will replace in REG_EQUAL and REG_EQUIV notes.  */
 
 void
 validate_replace_rtx_group (rtx from, rtx to, rtx insn)
 {
+  rtx note;
   validate_replace_rtx_1 (&PATTERN (insn), from, to, insn, true);
+  for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
+    if (REG_NOTE_KIND (note) == REG_EQUAL
+       || REG_NOTE_KIND (note) == REG_EQUIV)
+      validate_replace_rtx_1 (&XEXP (note, 0), from, to, insn, true);
 }
 
 /* Function called by note_uses to replace used subexpressions.  */
index a036f25080682624051a0a0786fa69b60b3fc3e9..e29c4c9ca43826405463e691c6e41378b7d76526 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-22  Michael Matz  <matz@suse.de>
+
+       PR middle-end/43475
+       * gfortran.dg/pr43475.f90: New testcase.
+
 2010-03-22  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/43390
diff --git a/gcc/testsuite/gfortran.dg/pr43475.f90 b/gcc/testsuite/gfortran.dg/pr43475.f90
new file mode 100644 (file)
index 0000000..72c0d18
--- /dev/null
@@ -0,0 +1,14 @@
+! PR middle-end/43475
+! { dg-do compile }
+! { dg-options "-O2" }
+subroutine ss(w)
+  implicit none
+  integer :: w(:)
+  integer :: b,c,d
+  b = w(8)
+  c = 5
+  d = 3
+  call s1(c)
+  call s2(b+c)
+  call s3(w(b))
+end subroutine ss