* varasm patch breaks sh-coff
@ 2000-09-11 11:07 Joern Rennecke
2000-09-11 11:25 ` Zack Weinberg
0 siblings, 1 reply; 4+ messages in thread
From: Joern Rennecke @ 2000-09-11 11:07 UTC (permalink / raw)
To: Zack Weinberg; +Cc: gcc
This patch:
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.132
retrieving revision 1.133
diff -p -r1.132 -r1.133
*** varasm.c 2000/08/30 22:50:51 1.132
--- varasm.c 2000/09/11 05:44:50 1.133
*************** make_decl_rtl (decl, asmspec, top_level)
*** 710,717 ****
reg_number = decode_reg_name (asmspec);
if (reg_number == -2)
! /* ASMSPEC is given, and not the name of a register. */
! new_name = asmspec;
if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
{
--- 710,723 ----
reg_number = decode_reg_name (asmspec);
if (reg_number == -2)
! {
! /* ASMSPEC is given, and not the name of a register. Mark the
! name with a star so assemble_name won't munge it. */
! char *starred = alloca (strlen (asmspec) + 2);
! starred[0] = '*';
! strcpy (starred + 1, asmspec);
! new_name = starred;
! }
if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
{
breaks sh-coff. In libgcc1-test.c, there is:
extern void __start() __asm__("__start");
/* Provide functions that might be needed by soft-float emulation routines. */
void *memcpy(void *to,
const void *from __attribute__((__unused__)),
size_t len __attribute__((__unused__)))
{
return to;
}
void start() {}
Your patch causes "*start" to be used for the identifier.
In sdbout.c:sdbout_symbol, the '*' is not stripped:
case FUNCTION_DECL:
/* Don't mention a nested function under its parent. */
context = decl_function_context (decl);
if (context == current_function_decl)
return;
/* Check DECL_INITIAL to distinguish declarations from definitions.
Don't output debug info here for declarations; they will have
a DECL_INITIAL value of 0. */
if (! DECL_INITIAL (decl))
return;
if (GET_CODE (DECL_RTL (decl)) != MEM
|| GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
return;
PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
PUT_SDB_VAL (XEXP (DECL_RTL (decl), 0));
PUT_SDB_SCL (TREE_PUBLIC (decl) ? C_EXT : C_STAT);
break;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: varasm patch breaks sh-coff
2000-09-11 11:07 varasm patch breaks sh-coff Joern Rennecke
@ 2000-09-11 11:25 ` Zack Weinberg
2000-09-11 11:52 ` sdbout.c patch to use assemble_name (Was: Re: varasm patch breaks sh-coff) Joern Rennecke
0 siblings, 1 reply; 4+ messages in thread
From: Zack Weinberg @ 2000-09-11 11:25 UTC (permalink / raw)
To: Joern Rennecke; +Cc: gcc
On Mon, Sep 11, 2000 at 07:06:49PM +0100, Joern Rennecke wrote:
> This patch:
[ * varasm.c (make_decl_rtl): Restore leading star on
DECL_ASSEMBLER_NAME set for decls with an asmspec.
]
> breaks sh-coff. In libgcc1-test.c, there is:
...
> Your patch causes "*start" to be used for the identifier.
> In sdbout.c:sdbout_symbol, the '*' is not stripped:
...
> PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
PUT_SDB_DEF (and all the other macros in sdbout.c that use
ASM_OUTPUT_LABELREF) should be using assemble_name instead. sdbout.c
is the only place in the compiler that does _not_ use assemble_name
for this purpose.
I can't test sh-coff; can you do the patch, please?
zw
^ permalink raw reply [flat|nested] 4+ messages in thread
* sdbout.c patch to use assemble_name (Was: Re: varasm patch breaks sh-coff)
2000-09-11 11:25 ` Zack Weinberg
@ 2000-09-11 11:52 ` Joern Rennecke
2000-09-11 15:12 ` Jeffrey A Law
0 siblings, 1 reply; 4+ messages in thread
From: Joern Rennecke @ 2000-09-11 11:52 UTC (permalink / raw)
To: Zack Weinberg; +Cc: gcc, gcc-patches
> PUT_SDB_DEF (and all the other macros in sdbout.c that use
> ASM_OUTPUT_LABELREF) should be using assemble_name instead. sdbout.c
> is the only place in the compiler that does _not_ use assemble_name
> for this purpose.
>
> I can't test sh-coff; can you do the patch, please?
I'm currently doing C tests with the following patch; if all goes well,
I should have a test result tomorrow.
Mon Sep 11 19:46:34 2000 J"orn Rennecke <amylaar@redhat.co.uk>
* sdbout.c (PUT_SDB_DEF, PUT_SDB_TAG, PUT_SDB_EPILOGUE_END):
Replace ASM_OUTPUT_LABELREF with assemble_name.
Index: sdbout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/sdbout.c,v
retrieving revision 1.33
diff -p -r1.33 sdbout.c
*** sdbout.c 2000/09/11 01:50:46 1.33
--- sdbout.c 2000/09/11 18:47:27
*************** static void sdbout_reg_parms PARAMS ((t
*** 161,169 ****
#ifndef PUT_SDB_DEF
#define PUT_SDB_DEF(a) \
do { fprintf (asm_out_file, "\t.def\t"); \
! ASM_OUTPUT_LABELREF (asm_out_file, a); \
fprintf (asm_out_file, SDB_DELIM); } while (0)
#endif
#ifndef PUT_SDB_PLAIN_DEF
--- 161,174 ----
#ifndef PUT_SDB_DEF
#define PUT_SDB_DEF(a) \
+
+ #undef PUT_SDB_DEF
+ PUT_SDB_DEF(a) \
+ char *a; {
do { fprintf (asm_out_file, "\t.def\t"); \
! assemble_name (asm_out_file, a); \
fprintf (asm_out_file, SDB_DELIM); } while (0)
+ ; }
#endif
#ifndef PUT_SDB_PLAIN_DEF
*************** do { fprintf (asm_out_file, "\t.def\t");
*** 202,208 ****
#ifndef PUT_SDB_TAG
#define PUT_SDB_TAG(a) \
do { fprintf (asm_out_file, "\t.tag\t"); \
! ASM_OUTPUT_LABELREF (asm_out_file, a); \
fprintf (asm_out_file, SDB_DELIM); } while (0)
#endif
--- 207,213 ----
#ifndef PUT_SDB_TAG
#define PUT_SDB_TAG(a) \
do { fprintf (asm_out_file, "\t.tag\t"); \
! assemble_name (asm_out_file, a); \
fprintf (asm_out_file, SDB_DELIM); } while (0)
#endif
*************** do { fprintf (asm_out_file, "\t.tag\t");
*** 237,243 ****
#ifndef PUT_SDB_EPILOGUE_END
#define PUT_SDB_EPILOGUE_END(NAME) \
do { fprintf (asm_out_file, "\t.def\t"); \
! ASM_OUTPUT_LABELREF (asm_out_file, NAME); \
fprintf (asm_out_file, \
"%s\t.val\t.%s\t.scl\t-1%s\t.endef\n", \
SDB_DELIM, SDB_DELIM, SDB_DELIM); } while (0)
--- 242,248 ----
#ifndef PUT_SDB_EPILOGUE_END
#define PUT_SDB_EPILOGUE_END(NAME) \
do { fprintf (asm_out_file, "\t.def\t"); \
! assemble_name (asm_out_file, NAME); \
fprintf (asm_out_file, \
"%s\t.val\t.%s\t.scl\t-1%s\t.endef\n", \
SDB_DELIM, SDB_DELIM, SDB_DELIM); } while (0)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sdbout.c patch to use assemble_name (Was: Re: varasm patch breaks sh-coff)
2000-09-11 11:52 ` sdbout.c patch to use assemble_name (Was: Re: varasm patch breaks sh-coff) Joern Rennecke
@ 2000-09-11 15:12 ` Jeffrey A Law
0 siblings, 0 replies; 4+ messages in thread
From: Jeffrey A Law @ 2000-09-11 15:12 UTC (permalink / raw)
To: Joern Rennecke; +Cc: Zack Weinberg, gcc, gcc-patches
In message < 200009111851.TAA08978@phal.cygnus.co.uk >you write:
> I'm currently doing C tests with the following patch; if all goes well,
> I should have a test result tomorrow.
>
> Mon Sep 11 19:46:34 2000 J"orn Rennecke <amylaar@redhat.co.uk>
>
> * sdbout.c (PUT_SDB_DEF, PUT_SDB_TAG, PUT_SDB_EPILOGUE_END):
> Replace ASM_OUTPUT_LABELREF with assemble_name.
If it tests OK, then consider the patch pre-approved.
jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-09-11 15:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-11 11:07 varasm patch breaks sh-coff Joern Rennecke
2000-09-11 11:25 ` Zack Weinberg
2000-09-11 11:52 ` sdbout.c patch to use assemble_name (Was: Re: varasm patch breaks sh-coff) Joern Rennecke
2000-09-11 15:12 ` Jeffrey A Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).