aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIlya Enkovich <ilya.enkovich@intel.com>2014-08-18 13:26:06 +0000
committerKirill Yukhin <kyukhin@gcc.gnu.org>2014-08-18 13:26:06 +0000
commitd34af02260f54bf3b5180855daa57e77ae5383d4 (patch)
tree43d6d2e3c39272c10953c9024618ac52bea882be /gcc
parent44f5982995af71f407b47de16e35a0276d88b862 (diff)
downloadgcc-d34af02260f54bf3b5180855daa57e77ae5383d4.zip
gcc-d34af02260f54bf3b5180855daa57e77ae5383d4.tar.gz
gcc-d34af02260f54bf3b5180855daa57e77ae5383d4.tar.bz2
re PR ipa/61800 (ICE: Segmentation fault during Firefox build)
PR ipa/61800 gcc/ * cgraph.h (cgraph_node::create_indirect_edge): Add compute_indirect_info param. * cgraph.c (cgraph_node::create_indirect_edge): Compute indirect_info only when it is required. * cgraphclones.c (cgraph_clone_edge): Do not recompute indirect_info fore cloned indirect edge. gcc/testsuite/ * g++.dg/ipa/pr61800.C: New. From-SVN: r214099
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/cgraph.c6
-rw-r--r--gcc/cgraph.h3
-rw-r--r--gcc/cgraphclones.c2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr61800.C67
6 files changed, 88 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 02a0da2..95f5de9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2014-08-18 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR ipa/61800
+ * cgraph.h (cgraph_node::create_indirect_edge): Add
+ compute_indirect_info param.
+ * cgraph.c (cgraph_node::create_indirect_edge): Compute
+ indirect_info only when it is required.
+ * cgraphclones.c (cgraph_clone_edge): Do not recompute
+ indirect_info fore cloned indirect edge.
+
2014-08-18 Alexander Ivchenko <alexander.ivchenko@intel.com>
Maxim Kuznetsov <maxim.kuznetsov@intel.com>
Anna Tikhonova <anna.tikhonova@intel.com>
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 370a96a..cb49cdc 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -942,7 +942,8 @@ cgraph_allocate_init_indirect_info (void)
struct cgraph_edge *
cgraph_node::create_indirect_edge (gimple call_stmt, int ecf_flags,
- gcov_type count, int freq)
+ gcov_type count, int freq,
+ bool compute_indirect_info)
{
struct cgraph_edge *edge = cgraph_node::create_edge (this, NULL, call_stmt,
count, freq, true);
@@ -954,7 +955,8 @@ cgraph_node::create_indirect_edge (gimple call_stmt, int ecf_flags,
edge->indirect_info->ecf_flags = ecf_flags;
/* Record polymorphic call info. */
- if (call_stmt
+ if (compute_indirect_info
+ && call_stmt
&& (target = gimple_call_fn (call_stmt))
&& virtual_method_call_p (target))
{
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 13c09af..2594ae5 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -915,7 +915,8 @@ public:
statement destination is a formal parameter of the caller with index
PARAM_INDEX. */
struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags,
- gcov_type count, int freq);
+ gcov_type count, int freq,
+ bool compute_indirect_info = true);
/* Like cgraph_create_edge walk the clone tree and update all clones sharing
same function body. If clones already have edge for OLD_STMT; only
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index c04b5c8..557f734 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -136,7 +136,7 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
{
new_edge = n->create_indirect_edge (call_stmt,
e->indirect_info->ecf_flags,
- count, freq);
+ count, freq, false);
*new_edge->indirect_info = *e->indirect_info;
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d378169..e43e295 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-18 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ * g++.dg/ipa/pr61800.C: New.
+
2014-08-18 Yury Gribov <y.gribov@samsung.com>
PR sanitizer/62089
diff --git a/gcc/testsuite/g++.dg/ipa/pr61800.C b/gcc/testsuite/g++.dg/ipa/pr61800.C
new file mode 100644
index 0000000..b4da899
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr61800.C
@@ -0,0 +1,67 @@
+/* PR ipa/61800 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#pragma GCC visibility push(hidden)
+class A
+{
+public:
+ unsigned long m_fn1 () const;
+};
+class B;
+class C
+{
+public:
+ ;
+ virtual bool m_fn2 (void) = 0;
+};
+class D
+{
+ virtual bool m_fn3 (const int &p1, B *p2) = 0;
+};
+class F : public D
+{
+ bool m_fn3 (const int &p1, B *p2);
+ A mPredicates;
+};
+class B
+{
+};
+class G : public B
+{
+ virtual unsigned int m_fn4 () = 0;
+};
+class H : public G
+{
+public:
+ int txNodeSetContext_aContextNodeSet;
+ H (B *p1) {}
+ int
+ m_fn5 ()
+ {
+ return mPosition < m_fn4 ();
+ }
+ unsigned int m_fn4 ();
+ unsigned int mPosition;
+};
+
+unsigned int a;
+C *b;
+bool
+F::m_fn3 (const int &p1, B *p2)
+{
+ if (!b->m_fn2 ())
+ return false;
+ unsigned int c = mPredicates.m_fn1 ();
+ for (1; 1 < c; ++a)
+ {
+ H d (p2);
+ while (d.m_fn5 ())
+ {
+ do
+ {
+ }
+ while (0);
+ }
+ }
+}