re PR tree-optimization/55260 (ICE: in ipa_get_parm_lattices, at ipa-cp.c:263 with...
authorMartin Jambor <mjambor@suse.cz>
Tue, 20 Nov 2012 11:20:41 +0000 (12:20 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 20 Nov 2012 11:20:41 +0000 (12:20 +0100)
2012-11-20  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/55260
* ipa-cp.c (find_aggregate_values_for_callers_subset): Rename info to
dest_info, use caller_info instead of info when determining whether
callee is a clone.

* testsuite/g++.dg/torture/pr55260-1.C: New test.

From-SVN: r193657

gcc/ChangeLog
gcc/ipa-cp.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr55260-1.C [new file with mode: 0644]

index 92c138fb925cce7786ae0fe8a60264f4e9b90b31..fc073b3de78fe81df7d9a47af57bbb8e00e5d9fc 100644 (file)
@@ -1,3 +1,10 @@
+2012-11-20  Martin Jambor  <mjambor@suse.cz>
+
+       PR tree-optimization/55260
+       * ipa-cp.c (find_aggregate_values_for_callers_subset): Rename info to
+       dest_info, use caller_info instead of info when determining whether
+       callee is a clone.
+
 2012-11-20  Andrey Turetskiy  <andrey.turetskiy@gmail.com>
 
        * config/i386/sse.md (*<ssse3_avx2>_pmulhrsw<mode>3): Merge
index 57382b5a3380ff4e87b1ad8698876f4c69143729..a0f5f5f085ca9a9e5739423a4fcbbae1a39ec5fc 100644 (file)
@@ -2859,10 +2859,10 @@ static struct ipa_agg_replacement_value *
 find_aggregate_values_for_callers_subset (struct cgraph_node *node,
                                          vec<cgraph_edge_p> callers)
 {
-  struct ipa_node_params *info = IPA_NODE_REF (node);
+  struct ipa_node_params *dest_info = IPA_NODE_REF (node);
   struct ipa_agg_replacement_value *res = NULL;
   struct cgraph_edge *cs;
-  int i, j, count = ipa_get_param_count (info);
+  int i, j, count = ipa_get_param_count (dest_info);
 
   FOR_EACH_VEC_ELT (callers, j, cs)
     {
@@ -2880,7 +2880,7 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node,
 
       /* Among other things, the following check should deal with all by_ref
         mismatches.  */
-      if (ipa_get_parm_lattices (info, i)->aggs_bottom)
+      if (ipa_get_parm_lattices (dest_info, i)->aggs_bottom)
        continue;
 
       FOR_EACH_VEC_ELT (callers, j, cs)
@@ -2932,7 +2932,7 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node,
              struct ipcp_param_lattices *src_plats;
              HOST_WIDE_INT delta = ipa_get_jf_ancestor_offset (jfunc);
 
-             if (info->ipcp_orig_node)
+             if (caller_info->ipcp_orig_node)
                {
                  if (!inter.exists ())
                    inter = agg_replacements_to_vector (cs->caller, delta);
index 1a9c0100385be955f3d21888b687fe139eaa9553..cb6518751f62a04d2478e60c5158196acab36e15 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-20  Martin Jambor  <mjambor@suse.cz>
+
+       PR tree-optimization/55260
+       * g++.dg/torture/pr55260-1.C: New test.
+
 2012-11-20  Sofiane Naci  <sofiane.naci@arm.com>
 
        * gcc.target/aarch64/atomic-comp-swap-release-acquire.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/torture/pr55260-1.C b/gcc/testsuite/g++.dg/torture/pr55260-1.C
new file mode 100644 (file)
index 0000000..552da8d
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu++0x -fno-inline" } */
+/* { dg-add-options bind_pic_locally } */
+
+  struct B
+  {
+  constexpr B ():
+    bp ()
+    {}
+    ~B ()
+    {
+      if (bp)
+       bp->f ();
+    }
+    void f ();
+    B *bp;
+  };
+struct A  {    B b;
+};
+
+void foo ()
+{
+  A a;
+}