This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

make_decl_rtl regression


A while ago, a regression was introduced by:

2004-08-04 Geoffrey Keating <geoffk@apple.com>

 PR 14516
 * c-common.c (c_expand_decl): Don't special-case static VAR_DECLs.
 * c-common.h (make_rtl_for_local_static): Delete.
 * c-decl.c (shadow_tag_warned): Clean up comment.
 (finish_decl): Clean up spacing. Use set_user_assembler_name when
 appropriate. Don't pass asmspec to rest_of_decl_compilation.
 * c-semantics.c (make_rtl_for_local_static): Delete.
 * expr.c (init_block_move_fn): Use set_user_assembler_name.
 (init_block_clear_fn): Likewise.
 * passes.c (rest_of_decl_compilation): Remove asmspec parameter,
 expect it to be in DECL_ASSEMBLER_NAME. Update callers in many files.
 * toplev.h (rest_of_decl_compilation): Remove asmspec parameter.
 * tree.h (make_decl_rtl): Remove second parameter.
 (set_user_assembler_name): New.
 * varasm.c (set_user_assembler_name): New.
 (make_decl_rtl): Remove second parameter. Update callers in many
 files.

the below fixes it. The problem is that asmspec is isn't just put into the DECL_ASSEMBLER_NAME field, and it isn't the only thing ever put into that field, rather, set_user_assembler_name prepends a '*' to the name first. To get at what we used to call the asmspec, we first have to advance past the '*', if there is no '*', trivially, there isn't an asmspec...


Ok?



2005-01-03 Mike Stump <mrs@apple.com>


 * varasm.c (make_decl_rtl): To get the register name from the
 DECL_ASSEMBLER_NAME, we have to undo set_user_assembler_name.

Doing diffs in .:
*** ./testsuite/gcc.dg/register-var-3.c.~1~ Mon Jan 3 15:56:51 2005
--- ./testsuite/gcc.dg/register-var-3.c Mon Jan 3 16:30:54 2005
***************
*** 0 ****
--- 1,4 ----
+ /* { dg-do compile } */
+ /* { dg-options "" } */
+
+ register int r1; /* { dg-error "register name not specified" } */
*** ./varasm.c.~1~ Mon Jan 3 15:51:19 2005
--- ./varasm.c Mon Jan 3 16:56:23 2005
*************** make_decl_rtl (tree decl)
*** 904,910 ****
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);
--- 904,912 ----
if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
{
! reg_number = -1;
! if (name[0] == '*')
! reg_number = decode_reg_name (name+1);
/* First detect errors in declaring global registers. */
if (reg_number == -1)
error ("%Jregister name not specified for %qD", decl, decl);
*************** make_decl_rtl (tree decl)
*** 962,968 ****
#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);
}
--- 964,970 ----
#ifdef REGISTER_PREFIX
if (strlen (REGISTER_PREFIX) != 0)
{
! reg_number = decode_reg_name (name+1);
if (reg_number >= 0 || reg_number == -3)
error ("%Jregister name given for non-register variable %qD", decl, decl);
}
--------------



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]