diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2004-12-02 14:05:50 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2004-12-02 06:05:50 -0800 |
commit | 30513cf6f9c3c62d17944079664808611f7613c1 (patch) | |
tree | eb0b4daf67ef3e3b5188988294375dc441f7648e /gcc | |
parent | bfe5acd6af822f4e8e668fe767b68b6704ea5d2b (diff) | |
download | gcc-30513cf6f9c3c62d17944079664808611f7613c1.zip gcc-30513cf6f9c3c62d17944079664808611f7613c1.tar.gz gcc-30513cf6f9c3c62d17944079664808611f7613c1.tar.bz2 |
varasm.c (decode_reg_name): Revert change to check for zero length strings.
2004-12-02 Andrew Pinski <pinskia@physics.uc.edu>
* varasm.c (decode_reg_name): Revert change to check for zero
length strings.
(make_decl_rtl): Make sure that we call decode_reg_name only
when needed.
From-SVN: r91638
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/varasm.c | 19 |
2 files changed, 20 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6b4ce0d..cd60511 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-12-02 Andrew Pinski <pinskia@physics.uc.edu> + + * varasm.c (decode_reg_name): Revert change to check for zero + length strings. + (make_decl_rtl): Make sure that we call decode_reg_name only + when needed. + 2004-12-02 Dorit Naishlos <dorit@il.ibm.com> PR tree-opt/18716 diff --git a/gcc/varasm.c b/gcc/varasm.c index e4fb1ee..d270701 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -791,7 +791,7 @@ set_user_assembler_name (tree decl, const char *name) int decode_reg_name (const char *asmspec) { - if (asmspec != 0 && strlen (asmspec) != 0) + if (asmspec != 0) { int i; @@ -901,10 +901,10 @@ make_decl_rtl (tree decl) name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - reg_number = decode_reg_name (name); if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl)) { + reg_number = decode_reg_name (name); /* First detect errors in declaring global registers. */ if (reg_number == -1) error ("%Jregister name not specified for %qD", decl, decl); @@ -955,12 +955,19 @@ make_decl_rtl (tree decl) return; } } - /* Now handle ordinary static variables and functions (in memory). Also handle vars declared register invalidly. */ - - if (name[0] == '*' && (reg_number >= 0 || reg_number == -3)) - error ("%Jregister name given for non-register variable %qD", decl, decl); + else if (name[0] == '*') + { +#ifdef REGISTER_PREFIX + if (strlen (REGISTER_PREFIX) != 0) + { + reg_number = decode_reg_name (name) + if (reg_number >= 0 || reg_number == -3) + error ("%Jregister name given for non-register variable %qD", decl, decl); + } +#endif + } /* Specifying a section attribute on a variable forces it into a non-.bss section, and thus it cannot be common. */ |