mirror of git://gcc.gnu.org/git/gcc.git
				
				
				
			re PR bootstrap/63622 (Bootstrap fails on x86_64-apple-darwin1[34] after revision r216305)
PR ipa/63622
        PR ipa/63795
	* g++.dg/ipa/ipa-icf-4.C: Add more precise dump scan.
	* g++.dg/ipa/ipa-icf-5.C: Add condition for target
	with symbol alias support.
	* ipa-icf.c (sem_function::merge): Add new target symbol alias
	support guard.
	(sem_variable::merge): Likewise.
	* ipa-icf.h (target_supports_symbol_aliases_p): New function.
From-SVN: r217355
			
			
This commit is contained in:
		
							parent
							
								
									cc7b5acf37
								
							
						
					
					
						commit
						f657d66569
					
				|  | @ -1,3 +1,12 @@ | ||||||
|  | 2014-11-11  Martin Liska  <mliska@suse.cz> | ||||||
|  | 
 | ||||||
|  | 	PR ipa/63622 | ||||||
|  | 	PR ipa/63795 | ||||||
|  | 	* ipa-icf.c (sem_function::merge): Add new target symbol alias | ||||||
|  | 	support guard. | ||||||
|  | 	(sem_variable::merge): Likewise. | ||||||
|  | 	* ipa-icf.h (target_supports_symbol_aliases_p): New function. | ||||||
|  | 
 | ||||||
| 2014-11-11  Richard Biener  <rguenther@suse.de> | 2014-11-11  Richard Biener  <rguenther@suse.de> | ||||||
| 
 | 
 | ||||||
| 	* match.pd: Implement patterns from associate_plusminus | 	* match.pd: Implement patterns from associate_plusminus | ||||||
|  |  | ||||||
|  | @ -191,6 +191,18 @@ sem_item::dump (void) | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /* Return true if target supports alias symbols.  */ | ||||||
|  | 
 | ||||||
|  | bool | ||||||
|  | sem_item::target_supports_symbol_aliases_p (void) | ||||||
|  | { | ||||||
|  | #if !defined (ASM_OUTPUT_DEF) || (!defined(ASM_OUTPUT_WEAK_ALIAS) && !defined (ASM_WEAKEN_DECL)) | ||||||
|  |   return false; | ||||||
|  | #else | ||||||
|  |   return true; | ||||||
|  | #endif | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /* Semantic function constructor that uses STACK as bitmap memory stack.  */ | /* Semantic function constructor that uses STACK as bitmap memory stack.  */ | ||||||
| 
 | 
 | ||||||
| sem_function::sem_function (bitmap_obstack *stack): sem_item (FUNC, stack), | sem_function::sem_function (bitmap_obstack *stack): sem_item (FUNC, stack), | ||||||
|  | @ -589,7 +601,8 @@ sem_function::merge (sem_item *alias_item) | ||||||
|       redirect_callers = false; |       redirect_callers = false; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|   if (create_alias && DECL_COMDAT_GROUP (alias->decl)) |   if (create_alias && (DECL_COMDAT_GROUP (alias->decl) | ||||||
|  | 		       || !sem_item::target_supports_symbol_aliases_p ())) | ||||||
|     { |     { | ||||||
|       create_alias = false; |       create_alias = false; | ||||||
|       create_thunk = true; |       create_thunk = true; | ||||||
|  | @ -605,6 +618,14 @@ sem_function::merge (sem_item *alias_item) | ||||||
|     local_original |     local_original | ||||||
|       = dyn_cast <cgraph_node *> (original->noninterposable_alias ()); |       = dyn_cast <cgraph_node *> (original->noninterposable_alias ()); | ||||||
| 
 | 
 | ||||||
|  |     if (!local_original) | ||||||
|  |       { | ||||||
|  | 	if (dump_file) | ||||||
|  | 	  fprintf (dump_file, "Noninterposable alias cannot be created.\n\n"); | ||||||
|  | 
 | ||||||
|  | 	return false; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|   if (redirect_callers) |   if (redirect_callers) | ||||||
|     { |     { | ||||||
|       /* If alias is non-overwritable then
 |       /* If alias is non-overwritable then
 | ||||||
|  | @ -649,7 +670,7 @@ sem_function::merge (sem_item *alias_item) | ||||||
|       alias->resolve_alias (original); |       alias->resolve_alias (original); | ||||||
| 
 | 
 | ||||||
|       /* Workaround for PR63566 that forces equal calling convention
 |       /* Workaround for PR63566 that forces equal calling convention
 | ||||||
| 	 to be used.  */ |        to be used.  */ | ||||||
|       alias->local.local = false; |       alias->local.local = false; | ||||||
|       original->local.local = false; |       original->local.local = false; | ||||||
| 
 | 
 | ||||||
|  | @ -1155,6 +1176,13 @@ sem_variable::merge (sem_item *alias_item) | ||||||
| { | { | ||||||
|   gcc_assert (alias_item->type == VAR); |   gcc_assert (alias_item->type == VAR); | ||||||
| 
 | 
 | ||||||
|  |   if (!sem_item::target_supports_symbol_aliases_p ()) | ||||||
|  |     { | ||||||
|  |       if (dump_file) | ||||||
|  | 	fprintf (dump_file, "Symbol aliases are not supported by target\n\n"); | ||||||
|  |       return false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|   sem_variable *alias_var = static_cast<sem_variable *> (alias_item); |   sem_variable *alias_var = static_cast<sem_variable *> (alias_item); | ||||||
| 
 | 
 | ||||||
|   varpool_node *original = get_node (); |   varpool_node *original = get_node (); | ||||||
|  |  | ||||||
|  | @ -138,9 +138,11 @@ public: | ||||||
| 
 | 
 | ||||||
|   /* Return base tree that can be used for compatible_types_p and
 |   /* Return base tree that can be used for compatible_types_p and
 | ||||||
|      contains_polymorphic_type_p comparison.  */ |      contains_polymorphic_type_p comparison.  */ | ||||||
| 
 |  | ||||||
|   static bool get_base_types (tree *t1, tree *t2); |   static bool get_base_types (tree *t1, tree *t2); | ||||||
| 
 | 
 | ||||||
|  |   /* Return true if target supports alias symbols.  */ | ||||||
|  |   bool target_supports_symbol_aliases_p (void); | ||||||
|  | 
 | ||||||
|   /* Item type.  */ |   /* Item type.  */ | ||||||
|   sem_item_type type; |   sem_item_type type; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,3 +1,11 @@ | ||||||
|  | 2014-11-11  Martin Liska  <mliska@suse.cz> | ||||||
|  | 
 | ||||||
|  | 	PR ipa/63622 | ||||||
|  | 	PR ipa/63795 | ||||||
|  | 	* g++.dg/ipa/ipa-icf-4.C: Add more precise dump scan. | ||||||
|  | 	* g++.dg/ipa/ipa-icf-5.C: Add condition for target | ||||||
|  | 	with symbol alias support. | ||||||
|  | 
 | ||||||
| 2014-11-10  Andi Kleen  <ak@linux.intel.com> | 2014-11-10  Andi Kleen  <ak@linux.intel.com> | ||||||
| 
 | 
 | ||||||
| 	* c-c++-common/cilk-plus/AN/misc.c (main): Handle | 	* c-c++-common/cilk-plus/AN/misc.c (main): Handle | ||||||
|  |  | ||||||
|  | @ -43,6 +43,6 @@ int main() | ||||||
|   return 123; |   return 123; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /* { dg-final { scan-ipa-dump "Varpool alias has been created" "icf"  } } */ | /* { dg-final { scan-ipa-dump "\(Varpool alias has been created\)|\(Symbol aliases are not supported by target\)" "icf"  } } */ | ||||||
| /* { dg-final { scan-ipa-dump "Equal symbols: 6" "icf"  } } */ | /* { dg-final { scan-ipa-dump "Equal symbols: 6" "icf"  } } */ | ||||||
| /* { dg-final { cleanup-ipa-dump "icf" } } */ | /* { dg-final { cleanup-ipa-dump "icf" } } */ | ||||||
|  |  | ||||||
|  | @ -1,5 +1,6 @@ | ||||||
| /* { dg-do compile } */ | /* { dg-do compile } */ | ||||||
| /* { dg-require-visibility "" } */ | /* { dg-require-visibility "" } */ | ||||||
|  | /* { dg-require-alias "" } */ | ||||||
| /* { dg-options "-O2 -fdump-ipa-icf" } */ | /* { dg-options "-O2 -fdump-ipa-icf" } */ | ||||||
| 
 | 
 | ||||||
| struct test | struct test | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Martin Liska
						Martin Liska