]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/44915 (ICE: SIGSEGV in walk_aliased_vdefs_1.constprop.42...
authorMartin Jambor <mjambor@suse.cz>
Fri, 23 Jul 2010 16:35:52 +0000 (18:35 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 23 Jul 2010 16:35:52 +0000 (18:35 +0200)
2010-07-23  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/44915
* ipa-cp.c (cgraph_gate_cp): Also check that optimize is true.
* ipa-inline.c (cgraph_mark_inline_edge): Likewise.
(analyze_function): Likewise.

* testsuite/g++.dg/torture/pr44915.C: New test.

From-SVN: r162469

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

index e674f39ec13aaeb5c0b8b640da0a17a16729087e..1701a548ed33c9a4acd68b4b616087ecc3ac6f54 100644 (file)
@@ -1,3 +1,10 @@
+2010-07-23  Martin Jambor  <mjambor@suse.cz>
+
+       PR tree-optimization/44915
+       * ipa-cp.c (cgraph_gate_cp): Also check that optimize is true.
+       * ipa-inline.c (cgraph_mark_inline_edge): Likewise.
+       (analyze_function): Likewise.
+
 2010-07-23  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/44914
index be1956962a8cf13c1e3ff5b65bfbee0ba728f332..6918273cba6a5a776687a44d68a1a120e0647804 100644 (file)
@@ -1278,7 +1278,9 @@ ipcp_read_summary (void)
 static bool
 cgraph_gate_cp (void)
 {
-  return flag_ipa_cp;
+  /* FIXME: We should remove the optimize check after we ensure we never run
+     IPA passes when not optimizng.  */
+  return flag_ipa_cp && optimize;
 }
 
 struct ipa_opt_pass_d pass_ipa_cp =
index b9e684489539cf8e67c4f90a5c6e9a0f54a16720..b5063bf8c228e02979b7446d9626da4b31d27a48 100644 (file)
@@ -334,7 +334,9 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
     overall_size += new_size - old_size;
   ncalls_inlined++;
 
-  if (flag_indirect_inlining)
+  /* FIXME: We should remove the optimize check after we ensure we never run
+     IPA passes when not optimizng.  */
+  if (flag_indirect_inlining && optimize)
     return ipa_propagate_indirect_call_infos (curr, new_edges);
   else
     return false;
@@ -2085,7 +2087,9 @@ analyze_function (struct cgraph_node *node)
   current_function_decl = node->decl;
 
   compute_inline_parameters (node);
-  if (flag_indirect_inlining)
+  /* FIXME: We should remove the optimize check after we ensure we never run
+     IPA passes when not optimizng.  */
+  if (flag_indirect_inlining && optimize)
     inline_indirect_intraprocedural_analysis (node);
 
   current_function_decl = NULL;
index fd8615fffac037b10929f1b9c2aa1b6324622ad3..9000fabf81166f3afa5184145cec8df3d62ea9f9 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-23  Martin Jambor  <mjambor@suse.cz>
+
+       PR tree-optimization/44915
+       * g++.dg/torture/pr44915.C: New test.
+
 2010-07-23  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/44914
diff --git a/gcc/testsuite/g++.dg/torture/pr44915.C b/gcc/testsuite/g++.dg/torture/pr44915.C
new file mode 100644 (file)
index 0000000..ba7e966
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile }  */
+/* { dg-options "-findirect-inlining" } */
+
+struct A;
+
+typedef void (A::*f_ptr) ();
+
+void dummy (f_ptr) { }
+
+void call_dummy (f_ptr cb)
+{
+  dummy (cb);
+}