This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

rtl_for_decl_location leaf register problems


Trying to build a sparclite-elf cross compiler fails with:

/local/src/sandbox/sparclite-elf/gcc/xgcc -B/local/src/sandbox/sparclite-elf/gcc
/ -nostdinc -B/local/src/sandbox/sparclite-elf/sparclite-elf/mflat/newlib/ -isys
tem /local/src/sandbox/sparclite-elf/sparclite-elf/mflat/newlib/targ-include -is
ystem /local/src/GNU/gcc-current/newlib/libc/include -B/local/sparclite-elf/bin/
 -B/local/sparclite-elf/lib/ -isystem /local/sparclite-elf/include  -mflat -DPAC
KAGE=\"newlib\" -DVERSION=\"1.8.2\"  -I. -I../../../../../../../GNU/gcc-current/
newlib/libc/stdlib  -O2 -DMALLOC_ALIGNMENT=8 -DMISSING_SYSCALL_NAMES -I../../tar
g-include -I../../../../../../../GNU/gcc-current/newlib/libc/../libc/include -fn
o-builtin      -g -O2  -mflat -c ../../../../../../../GNU/gcc-current/newlib/lib
c/stdlib/envlock.c
<command line>: warning: "cpu" re-asserted
<command line>: warning: "machine" re-asserted
../../../../../../../GNU/gcc-current/newlib/libc/stdlib/envlock.c: In function `
__env_lock':
../../../../../../../GNU/gcc-current/newlib/libc/stdlib/envlock.c:45: Internal c
ompiler error in leaf_renumber_regs_insn, at final.c:4254
Please submit a full bug report.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
make[5]: *** [envlock.o] Error 1
make[5]: Leaving directory `/local/src/sandbox/sparclite-elf/sparclite-elf/mflat
/newlib/libc/stdlib'

The preprocessed function is:

  void
  __env_lock (ptr)
       struct _reent *ptr;
  {
  }

The function is considered a candidate for leaf register
optimizations since it's empty.  rtl_for_decl_location
notices that the decl (reg/v/f:SI 106) represents a formal
paramter which was optimized out so it choses the
DECL_INCOMING_RTL (reg:SI 8 %o0).  This gets passed to
leaf_renumber_regs_insn which has a fit since LEAF_REG_REMAP
returns -1 for this register.

Any pointers to the proper solution?

envlock.i.00.rtl contains:

  (insn 4 1 5 (set (reg/v/f:SI 106)
          (reg:SI 8 %o0)) -1 (nil)
      (expr_list:REG_EQUIV (mem/f:SI (reg/f:SI 101 virtual-incoming-args) 4)
          (nil)))

  (note 5 4 7 NOTE_INSN_FUNCTION_BEG -1347440721)

  (note 7 5 8 NOTE_INSN_FUNCTION_END -1347440721)

  (code_label 9 8 0 2 "" "" [0 uses])

envlock.i.27.jump2 contains:

  (note 5 1 7 NOTE_INSN_FUNCTION_BEG -1347440721)

  (note 7 5 8 NOTE_INSN_FUNCTION_END -1347440721)

  (note 10 8 11 [bb 0] NOTE_INSN_BASIC_BLOCK -1347440721)

  (insn 11 10 15 (use (const_int 0 [0x0])) -1 (nil)
      (nil))

  (note 15 11 13 NOTE_INSN_DELETED -1347440721)

  (note 13 15 14 NOTE_INSN_DELETED -1347440721)

  (note 14 13 0 NOTE_INSN_DELETED -1347440721)

The gdb traceback is:

#0  leaf_renumber_regs_insn (in_rtx=0xdfb3ca00)
    at ../../../GNU/gcc-current/gcc/final.c:4254
#1  0x816635a in rtl_for_decl_location (decl=0xdfb03680)
    at ../../../GNU/gcc-current/gcc/dwarf2out.c:8597
#2  0x81663a5 in add_location_or_const_value_attribute (die=0x834b2d0, 
    decl=0xdfb03680) at ../../../GNU/gcc-current/gcc/dwarf2out.c:8628
#3  0x816871f in gen_formal_parameter_die (node=0xdfb03680, 
    context_die=0x834b610) at ../../../GNU/gcc-current/gcc/dwarf2out.c:9658
#4  0x816d6ac in gen_decl_die (decl=0xdfb03680, context_die=0x834b610)
    at ../../../GNU/gcc-current/gcc/dwarf2out.c:11125
#5  0x8169f7d in gen_subprogram_die (decl=0xdfb033a8, context_die=0x83357c8)
    at ../../../GNU/gcc-current/gcc/dwarf2out.c:10034
#6  0x816d2f9 in gen_decl_die (decl=0xdfb033a8, context_die=0x83357c8)
    at ../../../GNU/gcc-current/gcc/dwarf2out.c:11052
#7  0x816da75 in dwarf2out_decl (decl=0xdfb033a8)
    at ../../../GNU/gcc-current/gcc/dwarf2out.c:11273
#8  0x80b33fc in rest_of_compilation (decl=0xdfb033a8)
    at ../../../GNU/gcc-current/gcc/toplev.c:3730
#9  0x80849f3 in c_expand_body (fndecl=0xdfb033a8, nested_p=0)
    at ../../../GNU/gcc-current/gcc/c-decl.c:6819
#10 0x80847e9 in finish_function (nested=0)
    at ../../../GNU/gcc-current/gcc/c-decl.c:6740
#11 0x806f020 in yyparse_1 () at c-parse.y:323
#12 0x80737fa in yyparse () at ../../../GNU/gcc-current/gcc/c-lex.c:144
#13 0x80b166d in compile_file (name=0x8331579 "envlock.i")
    at ../../../GNU/gcc-current/gcc/toplev.c:2373
#14 0x80b4e3d in main (argc=7, argv=0x8047a90)
    at ../../../GNU/gcc-current/gcc/toplev.c:4859

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]