This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR87906
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 07 Nov 2018 19:47:43 +0100
- Subject: Re: [PATCH] Fix PR87906
- References: <alpine.LSU.2.20.1811070858000.1827@zhemvz.fhfr.qr>
Hi Richard,
> This adds a workaround for LTO decl merging prevailing a
> non-ultimate origin decl, breaking invariants of the middle-end.
> In the future (GCC 10) I hope to have DIE references here so
> this will not be an issue there anymore.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
>
> Richard.
>
> From ff035da8314ea8e0889b99bb338e67dd5dae455b Mon Sep 17 00:00:00 2001
> From: Richard Guenther <rguenther@suse.de>
> Date: Wed, 7 Nov 2018 08:56:52 +0100
> Subject: [PATCH] fix-pr87906
>
> 2018-11-07 Richard Biener <rguenther@suse.de>
>
> PR lto/87906
> * tree-streamer-in.c (lto_input_ts_block_tree_pointers): Fixup
> BLOCK_ABSTRACT_ORIGIN to be the ultimate origin.
>
> * g++.dg/lto/pr87906_0.C: New testcase.
> * g++.dg/lto/pr87906_1.C: Likewise.
>
> diff --git a/gcc/testsuite/g++.dg/lto/pr87906_0.C b/gcc/testsuite/g++.dg/lto/pr87906_0.C
> new file mode 100644
> index 00000000000..08e7ed3ba07
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/lto/pr87906_0.C
> @@ -0,0 +1,35 @@
> +// { dg-lto-do link }
> +// { dg-lto-options { { -O -fPIC -flto } } }
> +// { dg-extra-ld-options "-shared -nostdlib" }
> +
> +namespace com {
> +namespace sun {
> +namespace star {}
> +} // namespace sun
> +} // namespace com
> +namespace a = com::sun::star;
> +namespace com {
> +namespace sun {
> +namespace star {
> +namespace uno {
the new testcase FAILs on Solaris:
+FAIL: g++.dg/lto/pr87906 cp_lto_pr87906_0.o assemble, -O -fPIC -flto
+UNRESOLVED: g++.dg/lto/pr87906 cp_lto_pr87906_0.o-cp_lto_pr87906_1.o execute -O -fPIC -flto
+UNRESOLVED: g++.dg/lto/pr87906 cp_lto_pr87906_0.o-cp_lto_pr87906_1.o link -O -fPIC -flto
+FAIL: g++.dg/lto/pr87906 cp_lto_pr87906_1.o assemble, -O -fPIC -flto
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lto/pr87906_0.C:6:11: error: expected identifier before numeric constant
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lto/pr87906_0.C:6:11: error: expected unqualified-id before numeric constant
and several more due to the -Dsun default. How about
sed -e 's/sun/moon/g' instead ;-)
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University