aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2019-07-02 10:26:16 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2019-07-02 08:26:16 +0000
commitf51b4aed271f256f029ed4447141a7d1e8017a8c (patch)
tree11df4e794059123b748f4922525b9f1447fd59b7 /gcc
parent8bb9a5e66a150b73c97aeffee52b57147022a817 (diff)
downloadgcc-f51b4aed271f256f029ed4447141a7d1e8017a8c.zip
gcc-f51b4aed271f256f029ed4447141a7d1e8017a8c.tar.gz
gcc-f51b4aed271f256f029ed4447141a7d1e8017a8c.tar.bz2
tree-inline.c (remap_gimple_stmt): Do not subtitute handled components to clobber of return value.
* tree-inline.c (remap_gimple_stmt): Do not subtitute handled components to clobber of return value. * g++.dg/lto/pr90990_0.C: New testcase. From-SVN: r272925
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/lto/pr90990_0.C31
-rw-r--r--gcc/tree-inline.c12
4 files changed, 52 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9d1b648..e16e877 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,9 +1,13 @@
+2019-07-02 Jan Hubicka <jh@suse.cz>
+
+ * tree-inline.c (remap_gimple_stmt): Do not subtitute handled components
+ to clobber of return value.
+
2019-07-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/cortex-a57.md (cortex_a57_neon_type): Use neon_arith_basic
for is_neon_type instructions that have not already been categorized.
-
2019-07-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/58483
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e3a6b79..895eb3a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2019-07-02 Jan Hubicka <jh@suse.cz>
+
+ * g++.dg/lto/pr90990_0.C: New testcase.
+
2019-07-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/58483
diff --git a/gcc/testsuite/g++.dg/lto/pr90990_0.C b/gcc/testsuite/g++.dg/lto/pr90990_0.C
new file mode 100644
index 0000000..22a5e3f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr90990_0.C
@@ -0,0 +1,31 @@
+// { dg-lto-do link }
+/* { dg-extra-ld-options { -r -nostdlib } } */
+class A {
+public:
+ float m_floats;
+ A() {}
+};
+class B {
+public:
+ A operator[](int);
+};
+class C {
+ B m_basis;
+
+public:
+ A operator()(A) {
+ m_basis[1] = m_basis[2];
+ A a;
+ return a;
+ }
+};
+class D {
+public:
+ C m_fn1();
+};
+class F {
+ A m_pivotInB;
+ F(D &, const A &);
+};
+F::F(D &p1, const A &p2) : m_pivotInB(p1.m_fn1()(p2)) {}
+
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 450af46..42e4597 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1757,6 +1757,18 @@ remap_gimple_stmt (gimple *stmt, copy_body_data *id)
return NULL;
}
}
+
+ /* We do not allow CLOBBERs of handled components. In case
+ returned value is stored via such handled component, remove
+ the clobber so stmt verifier is happy. */
+ if (gimple_clobber_p (stmt)
+ && TREE_CODE (gimple_assign_lhs (stmt)) == RESULT_DECL)
+ {
+ tree remapped = remap_decl (gimple_assign_lhs (stmt), id);
+ if (!DECL_P (remapped)
+ && TREE_CODE (remapped) != MEM_REF)
+ return NULL;
+ }
if (gimple_debug_bind_p (stmt))
{