]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR ipa/61160 (wrong code with -O3 (or ICE: verify_cgraph_node failed: edge points...
authorMartin Jambor <mjambor@suse.cz>
Tue, 3 Jun 2014 10:09:20 +0000 (12:09 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 3 Jun 2014 10:09:20 +0000 (12:09 +0200)
2014-06-03  Martin Jambor  <mjambor@suse.cz>

PR ipa/61160
* ipa-cp.c (cgraph_edge_brings_value_p): Handle edges leading to
thunks.

testsuite/
* g++.dg/ipa/pr61160-1.C: New test.

From-SVN: r211170

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

index 411e71048ccc03b5e27cc4bcd4dc1b9fd58ca8be..9664949256cf66334a30b3ab30ecf9f607696b40 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-03  Martin Jambor  <mjambor@suse.cz>
+
+       PR ipa/61160
+       * ipa-cp.c (cgraph_edge_brings_value_p): Handle edges leading to
+       thunks.
+
 2014-06-03  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        PR tree-optimization/61328
index 08fb73e0e9366b42aa06a21ab471fc679a5a960e..33ff9b63f6c630b292812480cb23a589c418c459 100644 (file)
@@ -2482,7 +2482,8 @@ cgraph_edge_brings_value_p (struct cgraph_edge *cs,
                            struct ipcp_value_source *src)
 {
   struct ipa_node_params *caller_info = IPA_NODE_REF (cs->caller);
-  struct ipa_node_params *dst_info = IPA_NODE_REF (cs->callee);
+  cgraph_node *real_dest = cgraph_function_node (cs->callee);
+  struct ipa_node_params *dst_info = IPA_NODE_REF (real_dest);
 
   if ((dst_info->ipcp_orig_node && !dst_info->is_all_contexts_clone)
       || caller_info->node_dead)
index 9c0e9fb9632df7d0037e1f1f42fea6fe049cb043..14d79e1842fd4804827d7e1c0a478f31ed4dab70 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-03  Martin Jambor  <mjambor@suse.cz>
+
+       PR ipa/61160
+       * g++.dg/ipa/pr61160-1.C: New test.
+
 2014-06-03  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/61383
diff --git a/gcc/testsuite/g++.dg/ipa/pr61160-1.C b/gcc/testsuite/g++.dg/ipa/pr61160-1.C
new file mode 100644 (file)
index 0000000..a0fbb5f
--- /dev/null
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O3"  } */
+
+struct CBase {
+  virtual void BaseFunc () {}
+};
+
+struct MMixin {
+  virtual void * MixinFunc (int, void *) = 0;
+};
+
+struct CExample: CBase, public MMixin
+{
+  void *MixinFunc (int arg, void *arg2)
+  {
+    if (arg != 1 || arg2)
+      return 0;
+    return this;
+  }
+};
+
+void *test (MMixin & anExample)
+{
+  return anExample.MixinFunc (1, 0);
+}
+
+int main ()
+{
+  CExample c;
+  return (test (c) != &c);
+}