diff options
author | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-10-04 06:39:17 -0700 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-10-04 06:39:17 -0700 |
commit | 11e3f4b6f733c96148bea5747f793f020f4aeadb (patch) | |
tree | 106e20fbf3e5761d186df10f3b57e6e715d3c4b7 /gcc/varasm.c | |
parent | 46fbb29c2ee1a905f9cad8b5004ff79fcf82bfeb (diff) | |
download | gcc-11e3f4b6f733c96148bea5747f793f020f4aeadb.zip gcc-11e3f4b6f733c96148bea5747f793f020f4aeadb.tar.gz gcc-11e3f4b6f733c96148bea5747f793f020f4aeadb.tar.bz2 |
re PR middle-end/23125 (OpenBSD's zic.c causes g++ but not gcc to segfault)
2005-10-04 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/23125
* decl.c (make_rtl_for_nonlocal_decl): Use set_user_assembler_name
instead of change_decl_assembler_name.
2005-10-04 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/23125
* c-decl.c (finish_decl): Use set_user_assembler_name even for
register variables.
* varasm.c (make_decl_rtl): If a register variable does not
have a set user assmbler name, error out.
Decode the asmspec is now name+1 bypassing '*'.
2005-10-04 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/23125
* gcc.dg/register-var-3.c: New test.
From-SVN: r104942
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 91d2ea0c..f21c4b9 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -923,10 +923,16 @@ make_decl_rtl (tree decl) } name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - - if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl)) + + if (name[0] != '*' && TREE_CODE (decl) != FUNCTION_DECL + && DECL_REGISTER (decl)) + { + error ("register name not specified for %q+D", decl); + } + else if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl)) { - reg_number = decode_reg_name (name); + const char *asmspec = name+1; + reg_number = decode_reg_name (asmspec); /* First detect errors in declaring global registers. */ if (reg_number == -1) error ("register name not specified for %q+D", decl); |