[PATCH] Fix PCH failures on SPARC
Eric Botcazou
ebotcazou@libertysurf.fr
Fri Jun 20 09:10:00 GMT 2003
> Hi Eric,
Hi Dave,
> I believe that your patch causes some difficulty with the .stabs output
> on PA ports using som.h. Here is an example of an incorrect .stabs
> line. It causes 20011119-1.c to fail.
>
> .stabs "*xxx:F1",36,0,3,xxx
> .EXPORT xxx,ENTRY,PRIV_LEV=3,RTNVAL=GR
> .stabn 68,0,0,0
> xxx
> .PROC
> .CALLINFO FRAME=0,CALLS,SAVE_RP
> .ENTRY
> .stabn 68,0,3,L$M2-*xxx
>
> The last line causes an assembler error:
>
> /var/tmp//ccvFw2Ty.s: Assembler messages:
> /var/tmp//ccvFw2Ty.s:47: Error: bad expression
> /var/tmp//ccvFw2Ty.s:47: Warning: rest of line ignored; first ignored
> character is `x'
How can the patch produce such a problem?
Index: config/pa/som.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/som.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- config/pa/som.h 16 Jan 2003 00:34:43 -0000 1.41
+++ config/pa/som.h 17 Jun 2003 08:06:57 -0000 1.42
@@ -30,18 +30,17 @@
/* We make the first line stab special to avoid adding several
gross hacks to GAS. */
#undef ASM_OUTPUT_SOURCE_LINE
-#define ASM_OUTPUT_SOURCE_LINE(file, line) \
- { static int sym_lineno = 1; \
- static tree last_function_decl = NULL; \
+#define ASM_OUTPUT_SOURCE_LINE(file, line, counter) \
+ { static tree last_function_decl = NULL; \
if (current_function_decl == last_function_decl) \
fprintf (file, "\t.stabn 68,0,%d,L$M%d-%s\nL$M%d:\n", \
- line, sym_lineno, \
+ line, counter, \
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0) + 1, \
- sym_lineno); \
+ counter); \
else \
fprintf (file, "\t.stabn 68,0,%d,0\n", line); \
last_function_decl = current_function_decl; \
- sym_lineno += 1; }
+ }
/* gdb needs a null N_SO at the end of each file for scattered loading. */
--
Eric Botcazou
More information about the Gcc-patches
mailing list