* Fix lto/PR60854
@ 2014-04-17 2:33 Jan Hubicka
2014-04-17 8:00 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Jan Hubicka @ 2014-04-17 2:33 UTC (permalink / raw)
To: gcc-patches
Hi,
the testcase shows problem where cpp implicit alias is always inline and
symtab_remove_unreachable_nodes removes the body of aliased function before
inlininghappens. The real problem is that cgraph_state is set too early
and not as the comment says after inlinig, but for release branch I think
it is easier to sovle the problem by simply making the alias target
reachable by hand.
Bootstrapped/regtested x86_64-linux, comitted to trunk. Let me know
when it is OK for release brach.
Honza
Index: ChangeLog
===================================================================
--- ChangeLog (revision 209458)
+++ ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2014-04-16 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/60854
+ * ipa.c (symtab_remove_unreachable_nodes): Mark targets of
+ external aliases alive, too.
+
2014-04-16 Andrew Pinski <apinski@cavium.com>
* config/host-linux.c (TRY_EMPTY_VM_SPACE): Change aarch64 ilp32
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog (revision 209450)
+++ testsuite/ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2014-04-16 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/60854
+ * g++.dg/torture/pr60854.C: New testcase.
+
2014-04-16 Catherine Moore <clm@codesourcery.com>
* gcc.target/mips/umips-store16-2.c: New test.
Index: ipa.c
===================================================================
--- ipa.c (revision 209450)
+++ ipa.c (working copy)
@@ -415,7 +415,18 @@ symtab_remove_unreachable_nodes (bool be
|| !DECL_EXTERNAL (e->callee->decl)
|| e->callee->alias
|| before_inlining_p))
- pointer_set_insert (reachable, e->callee);
+ {
+ /* Be sure that we will not optimize out alias target
+ body. */
+ if (DECL_EXTERNAL (e->callee->decl)
+ && e->callee->alias
+ && before_inlining_p)
+ {
+ pointer_set_insert (reachable,
+ cgraph_function_node (e->callee));
+ }
+ pointer_set_insert (reachable, e->callee);
+ }
enqueue_node (e->callee, &first, reachable);
}
Index: testsuite/g++.dg/torture/pr60854.C
===================================================================
--- testsuite/g++.dg/torture/pr60854.C (revision 0)
+++ testsuite/g++.dg/torture/pr60854.C (revision 0)
@@ -0,0 +1,13 @@
+template <typename T>
+class MyClass
+{
+public:
+ __attribute__ ((__always_inline__)) inline MyClass () { ; }
+};
+
+extern template class MyClass<double>;
+
+void Func()
+{
+ MyClass<double> x;
+}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Fix lto/PR60854
2014-04-17 2:33 Fix lto/PR60854 Jan Hubicka
@ 2014-04-17 8:00 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2014-04-17 8:00 UTC (permalink / raw)
To: Jan Hubicka; +Cc: GCC Patches
On Thu, Apr 17, 2014 at 4:30 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> the testcase shows problem where cpp implicit alias is always inline and
> symtab_remove_unreachable_nodes removes the body of aliased function before
> inlininghappens. The real problem is that cgraph_state is set too early
> and not as the comment says after inlinig, but for release branch I think
> it is easier to sovle the problem by simply making the alias target
> reachable by hand.
>
> Bootstrapped/regtested x86_64-linux, comitted to trunk. Let me know
> when it is OK for release brach.
It's ok for 4.9.1.
Richard.
> Honza
>
> Index: ChangeLog
> ===================================================================
> --- ChangeLog (revision 209458)
> +++ ChangeLog (working copy)
> @@ -1,3 +1,9 @@
> +2014-04-16 Jan Hubicka <hubicka@ucw.cz>
> +
> + PR ipa/60854
> + * ipa.c (symtab_remove_unreachable_nodes): Mark targets of
> + external aliases alive, too.
> +
> 2014-04-16 Andrew Pinski <apinski@cavium.com>
>
> * config/host-linux.c (TRY_EMPTY_VM_SPACE): Change aarch64 ilp32
> Index: testsuite/ChangeLog
> ===================================================================
> --- testsuite/ChangeLog (revision 209450)
> +++ testsuite/ChangeLog (working copy)
> @@ -1,3 +1,8 @@
> +2014-04-16 Jan Hubicka <hubicka@ucw.cz>
> +
> + PR ipa/60854
> + * g++.dg/torture/pr60854.C: New testcase.
> +
> 2014-04-16 Catherine Moore <clm@codesourcery.com>
>
> * gcc.target/mips/umips-store16-2.c: New test.
> Index: ipa.c
> ===================================================================
> --- ipa.c (revision 209450)
> +++ ipa.c (working copy)
> @@ -415,7 +415,18 @@ symtab_remove_unreachable_nodes (bool be
> || !DECL_EXTERNAL (e->callee->decl)
> || e->callee->alias
> || before_inlining_p))
> - pointer_set_insert (reachable, e->callee);
> + {
> + /* Be sure that we will not optimize out alias target
> + body. */
> + if (DECL_EXTERNAL (e->callee->decl)
> + && e->callee->alias
> + && before_inlining_p)
> + {
> + pointer_set_insert (reachable,
> + cgraph_function_node (e->callee));
> + }
> + pointer_set_insert (reachable, e->callee);
> + }
> enqueue_node (e->callee, &first, reachable);
> }
>
> Index: testsuite/g++.dg/torture/pr60854.C
> ===================================================================
> --- testsuite/g++.dg/torture/pr60854.C (revision 0)
> +++ testsuite/g++.dg/torture/pr60854.C (revision 0)
> @@ -0,0 +1,13 @@
> +template <typename T>
> +class MyClass
> +{
> +public:
> + __attribute__ ((__always_inline__)) inline MyClass () { ; }
> +};
> +
> +extern template class MyClass<double>;
> +
> +void Func()
> +{
> + MyClass<double> x;
> +}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-17 7:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-17 2:33 Fix lto/PR60854 Jan Hubicka
2014-04-17 8:00 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).