aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-01-08 21:23:05 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2013-01-08 20:23:05 +0000
commit36b729105699ba208e17f22fd04f69c9d9cff72d (patch)
tree5da1cd3c072173cd3c6af1874bb0860ea4e36257 /gcc
parent8158c6570359ab4eedb325997e2417e87451fb9e (diff)
downloadgcc-36b729105699ba208e17f22fd04f69c9d9cff72d.zip
gcc-36b729105699ba208e17f22fd04f69c9d9cff72d.tar.gz
gcc-36b729105699ba208e17f22fd04f69c9d9cff72d.tar.bz2
re PR tree-optimization/55823 (ice in inline_call, at ipa-inline-transform.c:270)
PR tree-optimization/55823 * ipa-prop.c (update_indirect_edges_after_inlining): Fix ordering issue. From-SVN: r195033
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-prop.c52
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/ipa/devirt-10.C34
4 files changed, 69 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 83e0297..0575455 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-04 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/55823
+ * ipa-prop.c (update_indirect_edges_after_inlining): Fix ordering issue.
+
2012-01-08 Jakub Jelinek <jakub@redhat.com>
Uros Bizjak <ubizjak@gmail.com>
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index d225b85..2c7e13c 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -2264,40 +2264,15 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
param_index = ici->param_index;
jfunc = ipa_get_ith_jump_func (top, param_index);
- if (jfunc->type == IPA_JF_PASS_THROUGH
- && ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
- {
- if (ici->agg_contents
- && !ipa_get_jf_pass_through_agg_preserved (jfunc))
- ici->param_index = -1;
- else
- ici->param_index = ipa_get_jf_pass_through_formal_id (jfunc);
- }
- else if (jfunc->type == IPA_JF_ANCESTOR)
- {
- if (ici->agg_contents
- && !ipa_get_jf_ancestor_agg_preserved (jfunc))
- ici->param_index = -1;
- else
- {
- ici->param_index = ipa_get_jf_ancestor_formal_id (jfunc);
- ici->offset += ipa_get_jf_ancestor_offset (jfunc);
- }
- }
- else
- /* Either we can find a destination for this edge now or never. */
- ici->param_index = -1;
if (!flag_indirect_inlining)
- continue;
-
- if (ici->polymorphic)
+ new_direct_edge = NULL;
+ else if (ici->polymorphic)
new_direct_edge = try_make_edge_direct_virtual_call (ie, jfunc,
new_root_info);
else
new_direct_edge = try_make_edge_direct_simple_call (ie, jfunc,
new_root_info);
-
if (new_direct_edge)
{
new_direct_edge->indirect_inlining_edge = 1;
@@ -2312,6 +2287,29 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs,
res = true;
}
}
+ else if (jfunc->type == IPA_JF_PASS_THROUGH
+ && ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
+ {
+ if (ici->agg_contents
+ && !ipa_get_jf_pass_through_agg_preserved (jfunc))
+ ici->param_index = -1;
+ else
+ ici->param_index = ipa_get_jf_pass_through_formal_id (jfunc);
+ }
+ else if (jfunc->type == IPA_JF_ANCESTOR)
+ {
+ if (ici->agg_contents
+ && !ipa_get_jf_ancestor_agg_preserved (jfunc))
+ ici->param_index = -1;
+ else
+ {
+ ici->param_index = ipa_get_jf_ancestor_formal_id (jfunc);
+ ici->offset += ipa_get_jf_ancestor_offset (jfunc);
+ }
+ }
+ else
+ /* Either we can find a destination for this edge now or never. */
+ ici->param_index = -1;
}
return res;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d509109..f222874 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-04 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/55823
+ * g++.dg/ipa/devirt-10.C: New testcase.
+
2012-01-08 Uros Bizjak <ubizjak@gmail.com>
Vladimir Yakovlev <vladimir.b.yakovlev@intel.com>
diff --git a/gcc/testsuite/g++.dg/ipa/devirt-10.C b/gcc/testsuite/g++.dg/ipa/devirt-10.C
new file mode 100644
index 0000000..6550ff0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/devirt-10.C
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-ipa-inline -fdump-ipa-cp" } */
+class wxPaintEvent { };
+struct wxDCBase
+{
+ wxDCBase ();
+ virtual int GetLayoutDirection() const{}
+ virtual void SetLayoutDirection(int){}
+};
+struct wxWindowDC : public wxDCBase {};
+struct wxBufferedDC : public wxDCBase
+{
+ void Init(wxDCBase*dc) {
+ InitCommon(dc);
+ }
+ void InitCommon(wxDCBase*dc) {
+ if (dc)
+ SetLayoutDirection(dc->GetLayoutDirection());
+ }
+};
+struct wxBufferedPaintDC : public wxBufferedDC {
+ wxBufferedPaintDC() {
+ Init(&m_paintdc);
+ }
+ wxWindowDC m_paintdc;
+};
+void OnPaint(wxPaintEvent & event) {
+ wxBufferedPaintDC dc;
+}
+/* IPA-CP should really discover both cases, but for time being the second is handled by inliner. */
+/* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target" 1 "inline" } } */
+/* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target" 1 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */