aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-09-01 13:56:13 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-09-01 13:56:13 +0200
commitd1e2e50a5f4d077eab6d3c93047203d15f16b324 (patch)
tree6824c2194a8ff042cc8558a56c5bdb7e1db21e96
parent12b19f6aaf6a93be0bdc80e3d17540b94c58e157 (diff)
downloadgcc-d1e2e50a5f4d077eab6d3c93047203d15f16b324.zip
gcc-d1e2e50a5f4d077eab6d3c93047203d15f16b324.tar.gz
gcc-d1e2e50a5f4d077eab6d3c93047203d15f16b324.tar.bz2
re PR lto/91572 (lto1: error: type variant has different ‘TREE_TYPE’ since r269862)
PR lto/91572 * tree.c (find_decls_types_in_node): Also walk TREE_PURPOSE of GIMPLE_ASM TREE_LIST operands. * g++.dg/lto/pr91572_0.C: New test. From-SVN: r275266
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/lto/pr91572_0.C12
-rw-r--r--gcc/tree.c7
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2599314..d684c76 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-09-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR lto/91572
+ * tree.c (find_decls_types_in_node): Also walk TREE_PURPOSE of
+ GIMPLE_ASM TREE_LIST operands.
+
2019-08-31 Gerald Pfeifer <gerald@pfeifer.com>
* doc/generic.texi (Unary and Binary Expressions): Mark up
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c590b46..acb729d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-09-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR lto/91572
+ * g++.dg/lto/pr91572_0.C: New test.
+
2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91587
diff --git a/gcc/testsuite/g++.dg/lto/pr91572_0.C b/gcc/testsuite/g++.dg/lto/pr91572_0.C
new file mode 100644
index 0000000..95a7e9f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr91572_0.C
@@ -0,0 +1,12 @@
+// PR lto/91572
+// { dg-lto-do link }
+// { dg-lto-options { { -O -fPIC -flto } } }
+// { dg-require-effective-target shared }
+// { dg-require-effective-target fpic }
+// { dg-extra-ld-options "-shared" }
+
+void foo (char);
+namespace N {
+ class A { A (); };
+ A::A () { asm ("" : : "g" (0)); }
+}
diff --git a/gcc/tree.c b/gcc/tree.c
index 613efa5..afd7020 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -6142,6 +6142,13 @@ find_decls_types_in_node (struct cgraph_node *n, class free_lang_data_d *fld)
{
tree arg = gimple_op (stmt, i);
find_decls_types (arg, fld);
+ /* find_decls_types doesn't walk TREE_PURPOSE of TREE_LISTs,
+ which we need for asm stmts. */
+ if (arg
+ && TREE_CODE (arg) == TREE_LIST
+ && TREE_PURPOSE (arg)
+ && gimple_code (stmt) == GIMPLE_ASM)
+ find_decls_types (TREE_PURPOSE (arg), fld);
}
}
}