This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR: 19885 [4.0/4.1 Regression] avr dwarf-2 support is broken for head 4.0/4.1
- From: BjÃrn Haase <bjoern dot m dot haase at web dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Denis Chertykov <denisc at overta dot ru>
- Date: Mon, 16 May 2005 22:41:44 +0200
- Subject: [PATCH] PR: 19885 [4.0/4.1 Regression] avr dwarf-2 support is broken for head 4.0/4.1
- References: <20050210232514.19885.bjoern.m.haase@web.de> <20050516203005.31746.qmail@sourceware.org>
The origin of PR19885 were difficulties that showed up when emitting debugging
information for label references for the avr target. Main issue seemingly was
that the general dwarf2 code of gcc was not ready to deal with HImode
pointers.
The attached patch defines the target macros ASM_OUTPUT_DWARF_OFFSET and
ASM_OUTPUT_DWARF_DELTA and implements the corresponding functionality in two
tiny functions in avr.c . For these two output functions I have used
config/darwin.c as a template.
Since PR19885 is a regression in comparison to 3.4, I think that the patch
might be suitable for both 4.1 and 4.0.
Yours,
BjÃrn
2005-05-16 Bjoern Haase <bjoern.m.haase@web.de>
* config/avr/avr.h:
(ASM_OUTPUT_DWARF_OFFSET): Add.
(ASM_OUTPUT_DWARF_DELTA): Add.
* config/avr/avr.c:
(avr_asm_output_dwarf_delta): Add.
(avr_asm_output_dwarf_offset): Add.
Index: avr.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/avr/avr.h,v
retrieving revision 1.114
diff -c -r1.114 avr.h
*** avr.h 27 Apr 2005 17:02:34 -0000 1.114
--- avr.h 16 May 2005 19:56:49 -0000
***************
*** 56,61 ****
--- 56,65 ----
#define OVERRIDE_OPTIONS avr_override_options ()
#define CAN_DEBUG_WITHOUT_FP
+ #define ASM_OUTPUT_DWARF_DELTA(asm_out_file, size, lab1, lab2) \
+ avr_asm_output_dwarf_delta (asm_out_file,size,lab1,lab2)
+ #define ASM_OUTPUT_DWARF_OFFSET(asm_out_file, size, label) \
+ avr_asm_output_dwarf_offset (asm_out_file,size,label)
#define BITS_BIG_ENDIAN 0
#define BYTES_BIG_ENDIAN 0
Index: avr.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/avr/avr.c,v
retrieving revision 1.135
diff -c -r1.135 avr.c
*** avr.c 5 May 2005 15:42:03 -0000 1.135
--- avr.c 16 May 2005 19:56:57 -0000
***************
*** 1271,1276 ****
--- 1271,1303 ----
}
}
+ /* Output dwarf2 debugging info for labels and lable differences. */
+
+ void
+ avr_asm_output_dwarf_delta (FILE *file, int size,
+ const char *lab1, const char *lab2)
+ {
+ if (size == 2)
+ fprintf (file,"\t .word ");
+ else if (size == 4)
+ fprintf (file,"\t .long ");
+
+ assemble_name_raw (file,lab1);
+ fprintf (file,"-");
+ assemble_name_raw (file,lab2);
+ }
+
+ void
+ avr_asm_output_dwarf_offset (FILE *file, int size, const char *label)
+ {
+ if (size == 2)
+ fprintf (file,"\t .word ");
+ else if (size == 4)
+ fprintf (file,"\t .long ");
+
+ assemble_name_raw (file,label);
+ }
+
/* Return maximum number of consecutive registers of
class CLASS needed to hold a value of mode MODE. */