diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree.c | 35 |
2 files changed, 33 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7bc3702..4a98d09 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-07-13 Jan Hubicka <jh@suse.cz> + + * tree.c (decl_assembler_name_equal): Expect assembler name of decl + to be mangled too. + 2008-07-13 Richard Guenther <rguenther@suse.de> PR middle-end/36811 @@ -350,32 +350,53 @@ bool decl_assembler_name_equal (tree decl, const_tree asmname) { tree decl_asmname = DECL_ASSEMBLER_NAME (decl); + const char *decl_str; + const char *asmname_str; + bool test = false; if (decl_asmname == asmname) return true; + decl_str = IDENTIFIER_POINTER (decl_asmname); + asmname_str = IDENTIFIER_POINTER (asmname); + + /* If the target assembler name was set by the user, things are trickier. We have a leading '*' to begin with. After that, it's arguable what is the correct thing to do with -fleading-underscore. Arguably, we've historically been doing the wrong thing in assemble_alias by always printing the leading underscore. Since we're not changing that, make sure user_label_prefix follows the '*' before matching. */ - if (IDENTIFIER_POINTER (decl_asmname)[0] == '*') + if (decl_str[0] == '*') { - const char *decl_str = IDENTIFIER_POINTER (decl_asmname) + 1; size_t ulp_len = strlen (user_label_prefix); + decl_str ++; + if (ulp_len == 0) - ; + test = true; else if (strncmp (decl_str, user_label_prefix, ulp_len) == 0) - decl_str += ulp_len; + decl_str += ulp_len, test=true; else - return false; + decl_str --; + } + if (asmname_str[0] == '*') + { + size_t ulp_len = strlen (user_label_prefix); - return strcmp (decl_str, IDENTIFIER_POINTER (asmname)) == 0; + asmname_str ++; + + if (ulp_len == 0) + test = true; + else if (strncmp (asmname_str, user_label_prefix, ulp_len) == 0) + asmname_str += ulp_len, test=true; + else + asmname_str --; } - return false; + if (!test) + return false; + return strcmp (decl_str, asmname_str) == 0; } /* Hash asmnames ignoring the user specified marks. */ |