This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix ICF sem_function::merge (PR target/63892)


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]