ICE with x86, PIC, and dwarf2

Jeffrey A Law law@cygnus.com
Wed Sep 29 23:27:00 GMT 1999


  In message <19990628191129.G13359@cygnus.com>you write:
  > On Sat, Jun 26, 1999 at 05:34:29PM -0400, Zack Weinberg wrote:
  > > What's an UNSPEC doing there, anyway?  It's so print_operand_address in
  > > i386.c knows to print `__libc_pagesize@GOTOFF' instead of `__libc_pagesiz
  > e'. 
  > > Other architectures seem to do this differently.  I'm fairly sure i386 ou
  > ght
  > > to do it the way they do; getting the print_operand_address logic into
  > > dwarf2out would be awful, and dwarf2out doesn't seem to want @GOT/@GOTOFF
  > > suffixes anyway.
  > 
  > I have a hack for this sitting on a cygnus branch waiting to 
  > be reviewed.  Here's the raw diffs.
  > 
  > It's pretty gross.  Anyone care to suggest a better way?
  > 
  > 
  > r~
  > 
  > 
  > date: 1998/10/30 18:49:29;  author: rth;  state: Exp;  lines: +4 -0
  >         * dwarf2out.c (mem_loc_descriptor): Call ASM_SIMPLIFY_DWARF_ADDR
  >         if defined.
  >         * dwarfout.c (output_mem_loc_descriptor): Likewise.
  >         * i386.c (i386_simplify_dwarf_addr): New.
  >         * i386.h (ASM_SIMPLIFY_DWARF_ADDR): New.
  > 
  > date: 1998/10/29 00:01:43;  author: rth;  state: Exp;  lines: +22 -18
  >         * dwarf2out.c (ASM_OUTPUT_DWARF2_ADDR_CONST): Renamed from
  >         ASM_OUTPUT_DWARF_ADDR_CONST.  Update all callers.
  >         (dwarf2out_addr_const_to_string): Rename from addr_const_to_string.
  >         Make public.  Look for ASM_DWARF2_ADDR_CONST_TO_STRING and exit
  >         if it handles the rtx.
  >         * dwarf2out.h (dwarf2out_addr_const_to_string): Prototype.
  > 
  >         * i386.c (i386_dwarf1_output_addr_const): New.
  >         (i386_dwarf2_addr_to_string): New.
  >         * i386.h (ASM_OUTPUT_DWARF_ADDR_CONST): New.
  >         (ASM_DWARF2_ADDR_CONST_TO_STRING): New.
Might all this be made simpler by marking the SYMBOL_REF in some manner
(if SYMBOL_REF_FLAG is already taken, then ENCODE_SECTION_INFO can be used).

Then we can avoid the whole UNSPEC nonsense, at least for PIC references to
constant addresses.  Which in turn ought to avoid the need to bastardize
dwarf2out to handle this kind of stuff.

jeff



More information about the Gcc-bugs mailing list