This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICF sem_function::merge (PR target/63892)
- From: Iain Sandoe <iain at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Martin Liska <mliska at suse dot cz>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches Patches <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>, Dominique Dhumieres <dominiq at lps dot ens dot fr>
- Date: Sat, 21 Feb 2015 13:24:55 +0000
- Subject: Re: [PATCH] Fix ICF sem_function::merge (PR target/63892)
- Authentication-results: sourceware.org; auth=none
- References: <20150220144838 dot GD1746 at tucnak dot redhat dot com> <54E763E6 dot 5060402 at redhat dot com>
Hi Jakub, Martin,
On 20 Feb 2015, at 16:42, Jeff Law wrote:
> On 02/20/15 07:48, Jakub Jelinek wrote:
>> Hi!
>>
>> As written in the PR, the sibcall-3.c testcase fails on Darwin, because
>> !sem_item::target_supports_symbol_aliases_p () and we don't really try
>> redirect_callers, even when that is the best way to perform ICF (both
>> original and alias are local).
>>
>> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> OK.
This caused a bootstrap fail on Darwin, because of what looks like a typo in the re-factoring of the code (unfortunately, doesn't show up until stage#2).
I've bootstrapped the following patch on x86_64-linux and x86_64-darwin12, OK for trunk if wider testing passes?
Iain
P.S. The patch does solve a problem with ADT/SmallVectorTests.cpp in llvm suite (with generation of a varargs thunk).
However, it does not appear to restore sibcall-3 for m32 darwin (see. pr63892 for updated analysis).
gcc
* ipa-icf.c (sem_function::merge): Do not try to redirect unless the target supports
symbol aliases.
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index e1af8bf..f128494 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -662,6 +662,7 @@ sem_function::merge (sem_item *alias_item)
redirect_callers
= (!original_discardable
&& !DECL_COMDAT_GROUP (alias->decl)
+ && sem_item::target_supports_symbol_aliases_p ()
&& alias->get_availability () > AVAIL_INTERPOSABLE
&& original->get_availability () > AVAIL_INTERPOSABLE
&& !alias->instrumented_version);