]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/55260 (ICE: in ipa_get_parm_lattices, at ipa-cp.c:263 with...
authorMartin Jambor <mjambor@suse.cz>
Fri, 21 Feb 2014 13:05:40 +0000 (14:05 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 21 Feb 2014 13:05:40 +0000 (14:05 +0100)
2014-02-21  Martin Jambor  <mjambor@suse.cz>

PR ipa/55260
* ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Uce correct
info when checking whether lattices are bottom.

testsuite/
* gcc.dg/ipa/pr55260.c: New test.

From-SVN: r207990

gcc/ChangeLog
gcc/ipa-cp.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ipa/pr55260.c [new file with mode: 0644]

index cd7e837d5e94a84f139f9c46257d3d9f10ec73c3..40c1bc90c85a4ff61d9e6d5ffd8da71dce5a21d8 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-21  Martin Jambor  <mjambor@suse.cz>
+
+       PR ipa/55260
+       * ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Uce correct
+       info when checking whether lattices are bottom.
+
 2014-02-21  Jakub Jelinek  <jakub@redhat.com>
 
        * config/i386/i386.c (ix86_expand_vec_perm): Use V8SImode
index 7ea66f8cb6fcb07b23836c9f4bcafdf4e8aecee9..44a5e17d4a215d459bd08a1f08d6deac69442a0e 100644 (file)
@@ -3119,6 +3119,7 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
                                          struct cgraph_node *node)
 {
   struct ipa_node_params *orig_caller_info = IPA_NODE_REF (cs->caller);
+  struct ipa_node_params *orig_node_info;
   struct ipa_agg_replacement_value *aggval;
   int i, ec, count;
 
@@ -3133,6 +3134,7 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
       if (aggval->index >= ec)
        return false;
 
+  orig_node_info = IPA_NODE_REF (IPA_NODE_REF (node)->ipcp_orig_node);
   if (orig_caller_info->ipcp_orig_node)
     orig_caller_info = IPA_NODE_REF (orig_caller_info->ipcp_orig_node);
 
@@ -3150,7 +3152,7 @@ cgraph_edge_brings_all_agg_vals_for_node (struct cgraph_edge *cs,
       if (!interesting)
        continue;
 
-      plats = ipa_get_parm_lattices (orig_caller_info, aggval->index);
+      plats = ipa_get_parm_lattices (orig_node_info, aggval->index);
       if (plats->aggs_bottom)
        return false;
 
index 01e697ef962b4caffa894a1fd13ac0a3f94b4fd0..d8da360488dd14d8b7faf98408a996ffd04e2bcb 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-21  Martin Jambor  <mjambor@suse.cz>
+
+       PR ipa/55260
+       * gcc.dg/ipa/pr55260.c: New test.
+
 2014-02-19  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/49397
diff --git a/gcc/testsuite/gcc.dg/ipa/pr55260.c b/gcc/testsuite/gcc.dg/ipa/pr55260.c
new file mode 100644 (file)
index 0000000..ef151b0
--- /dev/null
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-inline -fipa-cp-clone"  } */
+
+typedef struct {
+  int *ptr;
+  int len;
+} string;
+typedef struct {
+  string nantstr;
+  int *nant;
+} malv;
+typedef struct {
+  int *nor;
+} list_heads;
+int b;
+list_heads *fn1(string, int *, unsigned);
+void fn2(malv *p1, list_heads *p2, unsigned p3) {
+  string a = p1->nantstr;
+  fn1(a, p1->nant, p3);
+}
+
+void fn3(unsigned p1) { fn2(0, 0, p1); }
+
+list_heads *fn1(string p1, int *p2, unsigned p3) {
+  while (1) {
+    if (p3)
+      fn3(1);
+    if (b)
+      return 0;
+    fn3(1);
+  }
+}
+
+void fn5() {
+  list_heads c;
+  c.nor = 0;
+  fn2(0, &c, 1);
+}