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]

[Patch,avr]: Fix wrong warning PR59396


This is a fix of a wrong warning for a bas ISR name. The assumption was that if DECL_ASSEMBLER_NAME is set, it would always starts with a *.

This is not the case for LTO compiler where the assembler name is the plain name of the function (except an assembler name is set).

Thus, do a more restrictive test if the first character of the function name has to be skipped.

Ok to commit?

Johann


	PR target/59396
	* config/avr/avr.c (avr_set_current_function): If the first char
	of the function name is skipped, make sure it is actually '*'.
Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c	(revision 205709)
+++ config/avr/avr.c	(working copy)
@@ -599,7 +599,8 @@ avr_set_current_function (tree decl)
       tree ret = TREE_TYPE (TREE_TYPE (decl));
       const char *name;
 
-      name = DECL_ASSEMBLER_NAME_SET_P (decl)
+      name = (DECL_ASSEMBLER_NAME_SET_P (decl)
+              && '*' == *IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)))
         /* Remove the leading '*' added in set_user_assembler_name.  */
         ? 1 + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))
         : IDENTIFIER_POINTER (DECL_NAME (decl));

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