]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/56117 (ICE: in cselib_subst_to_values, at cselib.c:1853 with...
authorJakub Jelinek <jakub@redhat.com>
Mon, 28 Jan 2013 16:50:22 +0000 (17:50 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 28 Jan 2013 16:50:22 +0000 (17:50 +0100)
PR rtl-optimization/56117
* sched-deps.c (sched_analyze_2) <case PREFETCH>: For use_cselib
call cselib_lookup_from_insn on the MEM before calling
add_insn_mem_dependence.

* gcc.dg/pr56117.c: New test.

From-SVN: r195513

gcc/ChangeLog
gcc/sched-deps.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr56117.c [new file with mode: 0644]

index 3bc0bd16d37f9627035d8a660f214ca77da52e03..cab97ef5553dc9d3c5e0036723d9e046c5648f98 100644 (file)
@@ -1,3 +1,10 @@
+2013-01-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/56117
+       * sched-deps.c (sched_analyze_2) <case PREFETCH>: For use_cselib
+       call cselib_lookup_from_insn on the MEM before calling
+       add_insn_mem_dependence.
+
 2013-01-28  Richard Biener  <rguenther@suse.de>
 
        * tree-inline.c (remap_gimple_stmt): Do not assing a BLOCK
index 2b4028663b16d4315f9cbc6866d14a4e48059a45..7de974b6358e9022e557038c81bd0a421f5a8910 100644 (file)
@@ -2720,8 +2720,12 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn)
         prefetch has only the start address but it is better to have
         something than nothing.  */
       if (!deps->readonly)
-       add_insn_mem_dependence (deps, true, insn,
-                                gen_rtx_MEM (Pmode, XEXP (PATTERN (insn), 0)));
+       {
+         rtx x = gen_rtx_MEM (Pmode, XEXP (PATTERN (insn), 0));
+         if (sched_deps_info->use_cselib)
+           cselib_lookup_from_insn (x, Pmode, true, VOIDmode, insn);
+         add_insn_mem_dependence (deps, true, insn, x);
+       }
       break;
 
     case UNSPEC_VOLATILE:
index fecca1e1c4934137bc248d3c479c158c35e1576c..ebc18d9bd27ea34cc6e6036d29d4e64934eb75c4 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/56117
+       * gcc.dg/pr56117.c: New test.
+
 2013-01-28  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/56034
diff --git a/gcc/testsuite/gcc.dg/pr56117.c b/gcc/testsuite/gcc.dg/pr56117.c
new file mode 100644 (file)
index 0000000..2422048
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR rtl-optimization/56117 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsched2-use-superblocks" } */
+
+void
+foo (void *p)
+{
+  __builtin_prefetch (p);
+}