This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: MIPS: Only use dwarf2 features if dwarf2 support is enabled.
- To: gavin at cygnus dot com
- Subject: RFA: MIPS: Only use dwarf2 features if dwarf2 support is enabled.
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Tue, 11 Jul 2000 12:58:53 -0700
- CC: gcc-patches at gcc dot gnu dot org
Hi Gavin,
Below is a small patch to prevent the MIPS toolchain from using some
DWARF2 features unless DWARF2 support has been enabled. I found
this to be a problem when building the mips-wince target which does
not use DWARF2.
The problem with defining INCOMING_RETURN_ADDR_RTX is that this
causes DWARF2_UNWIND_INFO to be defined (in gcc/defaults.h) which in
turn causes a lot of code in dwarf2out.c to be enabled. In
particular the function output_loc_operands() is compiled, which
uses the macro ASM_OUTPUT_DWARF_ADDR_CONST, which is not defined in
a non-DWARF environment.
OK to apply ?
Cheers
Nick
2000-07-11 Nick Clifton <nickc@cygnus.com>
* config/mips/mips.h (INCOMING_RETURN_ADDR_RTX): Only define
for targets that support DWARF2.
* config/mips/mips.c (function_prologue): Only call
dwarf2out_def_cfa if DWARF2 support is enabled.
Index: mips.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/config/mips/mips.h,v
retrieving revision 1.224
diff -p -r1.224 mips.h
*** mips.h 2000/06/22 15:27:48 1.224
--- mips.h 2000/07/11 19:42:44
*************** while (0)
*** 1356,1362 ****
--- 1356,1364 ----
#define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1)
/* Before the prologue, RA lives in r31. */
+ #ifdef DWARF2_DEBUGGING_INFO
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31)
+ #endif
/* Overrides for the COFF debug format. */
#define PUT_SDB_SCL(a) \
Index: mips.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/config/mips/mips.c,v
retrieving revision 1.202
diff -p -r1.202 mips.c
*** mips.c 2000/06/24 20:03:51 1.202
--- mips.c 2000/07/11 19:42:44
*************** function_prologue (file, size)
*** 7426,7434 ****
sp_str, sp_str, tsize);
fprintf (file, "\t.cprestore %ld\n", current_frame_info.args_size);
}
!
if (dwarf2out_do_frame ())
dwarf2out_def_cfa ("", STACK_POINTER_REGNUM, tsize);
}
}
--- 7426,7435 ----
sp_str, sp_str, tsize);
fprintf (file, "\t.cprestore %ld\n", current_frame_info.args_size);
}
! #ifdef DWARF2_DEBUGGING_INFO
if (dwarf2out_do_frame ())
dwarf2out_def_cfa ("", STACK_POINTER_REGNUM, tsize);
+ #endif
}
}