[gcc-6] 194/401: * Fix PR c++/77379, taken from the trunk.
Ximin Luo
infinity0 at debian.org
Wed Apr 5 15:49:18 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch pu/reproducible_builds
in repository gcc-6.
commit b5e50622273304e1e57005c44ff38e55c4a595b9
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date: Tue Aug 30 17:20:44 2016 +0000
* Fix PR c++/77379, taken from the trunk.
git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-6@8958 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
debian/changelog | 1 +
debian/patches/pr77379.diff | 173 ++++++++++++++++++++++++++++++++++++++++++++
debian/rules.patch | 1 +
3 files changed, 175 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index eb855e7..f09147a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ gcc-6 (6.2.0-2) UNRELEASED; urgency=medium
* Update multiarch patches for mips* r6 (YunQiang Su).
* Fix install location of D header files for cross builds (YunQiang Su).
Closes: #835847.
+ * Fix PR c++/77379, taken from the trunk.
-- Matthias Klose <doko at debian.org> Wed, 24 Aug 2016 08:07:34 +0200
diff --git a/debian/patches/pr77379.diff b/debian/patches/pr77379.diff
new file mode 100644
index 0000000..c746311
--- /dev/null
+++ b/debian/patches/pr77379.diff
@@ -0,0 +1,173 @@
+# DP: Fix PR c++/77379, taken from the trunk.
+
+gcc/cp/
+
+2016-08-29 Jason Merrill <jason at redhat.com>
+
+ PR c++/77379
+ * mangle.c (maybe_check_abi_tags): Add version parm, handle thunks.
+ (mangle_thunk): Add thunk parameter.
+ * method.c (finish_thunk): Pass it.
+ * cp-tree.h: Declare it.
+
+
+Index: b/src/gcc/testsuite/g++.dg/abi/abi-tag23a.C
+===================================================================
+--- /dev/null
++++ b/src/gcc/testsuite/g++.dg/abi/abi-tag23a.C
+@@ -0,0 +1,35 @@
++// PR c++/77379
++// { dg-options -fabi-version=10 }
++
++struct __attribute ((abi_tag ("bar"))) string { };
++
++struct Mother
++{
++ virtual ~Mother() {};
++ int bar;
++};
++
++struct Father
++{
++ virtual string get_foo() = 0;
++};
++
++class Derived:
++ public Mother,
++ public Father
++{
++public:
++ string get_foo();
++};
++
++struct Final:
++ public Derived
++{
++};
++
++int main()
++{
++ Final().get_foo();
++}
++
++// { dg-final { scan-assembler "_ZThn16_N7Derived7get_fooEv" } }
+Index: b/src/gcc/testsuite/g++.dg/abi/abi-tag23.C
+===================================================================
+--- /dev/null
++++ b/src/gcc/testsuite/g++.dg/abi/abi-tag23.C
+@@ -0,0 +1,35 @@
++// PR c++/77379
++// { dg-options "-fabi-version=0 -Wabi=10" }
++
++struct __attribute ((abi_tag ("bar"))) string { };
++
++struct Mother
++{
++ virtual ~Mother() {};
++ int bar;
++};
++
++struct Father
++{
++ virtual string get_foo() = 0;
++};
++
++class Derived:
++ public Mother,
++ public Father
++{
++public:
++ string get_foo(); // { dg-warning "mangled name" }
++};
++
++struct Final:
++ public Derived
++{
++};
++
++int main()
++{
++ Final().get_foo();
++}
++
++// { dg-final { scan-assembler "_ZThn16_N7Derived7get_fooB3barEv" } }
+Index: b/src/gcc/cp/method.c
+===================================================================
+--- a/src/gcc/cp/method.c
++++ b/src/gcc/cp/method.c
+@@ -169,7 +169,7 @@ finish_thunk (tree thunk)
+ virtual_offset = BINFO_VPTR_FIELD (virtual_offset);
+ function = THUNK_TARGET (thunk);
+ name = mangle_thunk (function, DECL_THIS_THUNK_P (thunk),
+- fixed_offset, virtual_offset);
++ fixed_offset, virtual_offset, thunk);
+
+ /* We can end up with declarations of (logically) different
+ covariant thunks, that do identical adjustments. The two thunks
+Index: b/src/gcc/cp/mangle.c
+===================================================================
+--- a/src/gcc/cp/mangle.c
++++ b/src/gcc/cp/mangle.c
+@@ -223,7 +223,7 @@ static void write_local_name (tree, cons
+ static void dump_substitution_candidates (void);
+ static tree mangle_decl_string (const tree);
+ static int local_class_index (tree);
+-static void maybe_check_abi_tags (tree, tree = NULL_TREE);
++static void maybe_check_abi_tags (tree, tree = NULL_TREE, int = 10);
+
+ /* Control functions. */
+
+@@ -3885,10 +3885,13 @@ mangle_call_offset (const tree fixed_off
+
+ tree
+ mangle_thunk (tree fn_decl, const int this_adjusting, tree fixed_offset,
+- tree virtual_offset)
++ tree virtual_offset, tree thunk)
+ {
+ tree result;
+
++ if (abi_version_at_least (11))
++ maybe_check_abi_tags (fn_decl, thunk, 11);
++
+ start_mangling (fn_decl);
+
+ write_string ("_Z");
+@@ -4003,7 +4006,7 @@ mangle_conv_op_name_for_type (const tree
+ guard variable for T. */
+
+ static void
+-maybe_check_abi_tags (tree t, tree for_decl)
++maybe_check_abi_tags (tree t, tree for_decl, int ver)
+ {
+ if (DECL_ASSEMBLER_NAME_SET_P (t))
+ return;
+@@ -4018,9 +4021,14 @@ maybe_check_abi_tags (tree t, tree for_d
+ if (!attr)
+ attr = lookup_attribute ("abi_tag", DECL_ATTRIBUTES (t));
+ if (attr && TREE_VALUE (attr) != oldtags
+- && abi_version_crosses (10))
++ && abi_version_crosses (ver))
+ {
+- if (for_decl)
++ if (for_decl && DECL_THUNK_P (for_decl))
++ warning_at (DECL_SOURCE_LOCATION (t), OPT_Wabi,
++ "the mangled name of a thunk for %qD changes between "
++ "-fabi-version=%d and -fabi-version=%d",
++ t, flag_abi_version, warn_abi_version);
++ else if (for_decl)
+ warning_at (DECL_SOURCE_LOCATION (for_decl), OPT_Wabi,
+ "the mangled name of %qD changes between "
+ "-fabi-version=%d and -fabi-version=%d",
+Index: b/src/gcc/cp/cp-tree.h
+===================================================================
+--- a/src/gcc/cp/cp-tree.h
++++ b/src/gcc/cp/cp-tree.h
+@@ -6757,7 +6757,7 @@ extern tree mangle_typeinfo_string_for_t
+ extern tree mangle_vtbl_for_type (tree);
+ extern tree mangle_vtt_for_type (tree);
+ extern tree mangle_ctor_vtbl_for_type (tree, tree);
+-extern tree mangle_thunk (tree, int, tree, tree);
++extern tree mangle_thunk (tree, int, tree, tree, tree);
+ extern tree mangle_conv_op_name_for_type (tree);
+ extern tree mangle_guard_variable (tree);
+ extern tree mangle_tls_init_fn (tree);
diff --git a/debian/rules.patch b/debian/rules.patch
index 512a04a..b7f9161 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -90,6 +90,7 @@ debian_patches += \
libjava-mips64el \
PR55947-revert \
gccgo-issue16780 \
+ pr77379 \
# vulcan-cpu$(if $(with_linaro_branch),-linaro) \
# this is still needed on powerpc, e.g. firefox and insighttoolkit4 will ftbfs.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-6.git
More information about the Reproducible-commits
mailing list