------- Additional Comments From hjl at lucon dot org 2004-11-23 21:13 ------- Does this patch
--- gcc/c-pragma.c.rename 2004-11-09 12:03:42.000000000 -0800 +++ gcc/c-pragma.c 2004-11-23 13:03:26.020304351 -0800 @@ -473,8 +473,11 @@ maybe_apply_renaming_pragma (tree decl, return asmname; /* If the DECL_ASSEMBLER_NAME is already set, it does not change, - but we may warn about a rename that conflicts. */ - if (DECL_ASSEMBLER_NAME_SET_P (decl)) + but we may warn about a rename that conflicts. + FIXME: the DECL_ASSEMBLER_NAME can be set to DECL_NAME (decl) + without renaming pragma nor asm declaration involved. */ + if (DECL_ASSEMBLER_NAME_SET_P (decl) + && DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)) { const char *oldname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); oldname = targetm.strip_name_encoding (oldname); make any senses? At least, it works with my testcases. -O0 and -O1 still complain with [EMAIL PROTECTED] gcc]$ ./xgcc -B./ -c x.i x.i:8: warning: foo renamed after being referenced in assembly [EMAIL PROTECTED] gcc]$ It may be OK since foo has been referenced in assembly. But I am not sure about languanges other than C. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982