This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Nov 2004 21:13:52 -0000
- Subject: [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
- References: <20041013220543.17982.schwab@suse.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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
[hjl@gnu-4 gcc]$ ./xgcc -B./ -c x.i
x.i:8: warning: foo renamed after being referenced in assembly
[hjl@gnu-4 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