[m68k] Fix for Bug #17114

Peter Barada peter@the-baradas.com
Sat Sep 4 13:49:00 GMT 2004


>On Fri, Sep 03, 2004 at 06:16:30PM -0400, Peter Barada wrote:
>> 	* config/m68k/m68k.h (EXTRA_CONSTRAINT): Accept only vaid
>> 	  offsets in 'U' case; alos allow register indirect in 'U' case.
>
>This is ok, as far as it goes.  You should also add
>
>#define EXTRA_MEMORY_CONSTRAINT(C, STR) \
>  ((C) == 'Q' || (C) == 'U')
>
>so that reload knows how to fix up the operand, should the 
>constraint not match.

I just tried that and it blows up with:

/home/peter/work/cvs-gnu/obj/gcc/xgcc -B/home/peter/work/cvs-gnu/obj/gcc/ -nostdinc -B/home/peter/work/cvs-gnu/obj/m68k-elf/newlib/ -isystem /home/peter/work/cvs-gnu/obj/m68k-elf/newlib/targ-include -isystem /home/peter/work/cvs-gnu/uberbaum/newlib/libc/include -B/tmp/uberbaum/m68k-elf/bin/ -B/tmp/uberbaum/m68k-elf/lib/ -isystem /tmp/uberbaum/m68k-elf/include -isystem /tmp/uberbaum/m68k-elf/sys-include -L/home/peter/work/cvs-gnu/obj/ld -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I -I/home/peter/work/cvs-gnu/uberbaum/gcc -I/home/peter/work/cvs-gnu/uberbaum/gcc/ -I/home/peter/work/cvs-gnu/uberbaum/gcc/../include -I/home/peter/work/cvs-gnu/uberbaum/gcc/../libcpp/include -I/home/peter/work/cvs-gnu/uberbaum/gcc/../libbanshee/libcompat -I/home/peter/work/cvs-gnu/uberbaum/gcc/../libbanshee -I/home/peter/work/cvs-gnu/uberbaum
 /gcc/../libbanshee/points-to  -m5200 -fexceptions -c /home/peter/work/cvs-gnu/uberbaum/gcc/unwind-dw2-fde.c -o libgcc/m5200/unwind-dw2-fde.o
/home/peter/work/cvs-gnu/uberbaum/gcc/unwind-dw2-fde.c:1031: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [libgcc/m5200/unwind-dw2-fde.o] Error 1
make[2]: Leaving directory `/home/peter/work/cvs-gnu/obj/gcc'


>From GDB:

Starting program: /home/peter/work/cvs-gnu/obj/gcc/cc1 -quiet -nostdinc -I. -I -I/home/peter/work/cvs-gnu/uberbaum/gcc -I/home/peter/work/cvs-gnu/uberbaum/gcc/ -I/home/peter/work/cvs-gnu/uberbaum/gcc/../include -I/home/peter/work/cvs-gnu/uberbaum/gcc/../libcpp/include -I/home/peter/work/cvs-gnu/uberbaum/gcc/../libbanshee/libcompat -I/home/peter/work/cvs-gnu/uberbaum/gcc/../libbanshee -I/home/peter/work/cvs-gnu/uberbaum/gcc/../libbanshee/points-to -iprefix /home/peter/work/cvs-gnu/obj/gcc/../lib/gcc/m68k-elf/3.5.0/ -isystem /home/peter/work/cvs-gnu/obj/gcc/include -DIN_GCC -DCROSS_COMPILE -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -isystem /home/peter/work/cvs-gnu/obj/m68k-elf/newlib/targ-include -isystem /home/peter/work/cvs-gnu/uberbaum/newlib/libc/include -isystem /tmp/uberbaum/m68k-elf/include -isystem /tmp/uberbaum/m68k-elf/sys-include -isystem ./include /home/peter/work/cvs-gnu/uberbaum/gcc/unwind-dw2-fde.c -quiet -dumpbase unwind-dw2-fde.c -m5200 -auxbase-stri
 p libgcc/m5200/unwind-dw2-fde.o -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -version -fexceptions -o /tmp/ccjo3huh.s
GNU C version 3.5.0 20040826 (experimental) (m68k-elf)
	compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.3 2.96-113).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Program received signal SIGSEGV, Segmentation fault.
0x082c1e6c in default_strip_name_encoding (str=0x9 <Address 0x9 out of bounds>)
    at /home/peter/work/cvs-gnu/uberbaum/gcc/varasm.c:5060
(gdb) where
#0  0x082c1e6c in default_strip_name_encoding (str=0x9 <Address 0x9 out of bounds>)
    at /home/peter/work/cvs-gnu/uberbaum/gcc/varasm.c:5060
#1  0x082babed in assemble_name (file=0x8416c60, name=0x9 <Address 0x9 out of bounds>)
    at /home/peter/work/cvs-gnu/uberbaum/gcc/varasm.c:1845
#2  0x082ba000 in asm_emit_uninitialised (decl=0x40137570, 
    name=0x9 <Address 0x9 out of bounds>, size=4, rounded=4)
    at /home/peter/work/cvs-gnu/uberbaum/gcc/varasm.c:1458
#3  0x082ba62d in assemble_variable (decl=0x40137570, top_level=0, at_end=1, 
    dont_output_data=0) at /home/peter/work/cvs-gnu/uberbaum/gcc/varasm.c:1653
#4  0x082d66d8 in cgraph_varpool_assemble_pending_decls ()
    at /home/peter/work/cvs-gnu/uberbaum/gcc/cgraph.c:642
#5  0x0829d000 in compile_file () at /home/peter/work/cvs-gnu/uberbaum/gcc/toplev.c:996
#6  0x0829e4d2 in do_compile () at /home/peter/work/cvs-gnu/uberbaum/gcc/toplev.c:2065
#7  0x0829e52a in toplev_main (argc=50, argv=0xbfffdcc4)
    at /home/peter/work/cvs-gnu/uberbaum/gcc/toplev.c:2097
#8  0x42017589 in __libc_start_main () from /lib/i686/libc.so.6
(gdb) 

The decl looks like:

(gdb) call debug_tree(decl)
 <var_decl 0x40137570 unseen_objects
    type <pointer_type 0x40123f68
        type <record_type 0x4012315c object asm_written type_0 BLK
            size <integer_cst 0x40038048 constant invariant 192>
            unit size <integer_cst 0x40038090 constant invariant 24>
            align 16 symtab 1074954752 alias set 11 fields <field_decl 0x40123244 pc_begin> context <translation_unit_decl 0x4018d9f8>
            pointer_to_this <pointer_type 0x40123f68> chain <type_decl 0x401231d0>>
        asm_written public unsigned SI
        size <integer_cst 0x4001f408 constant invariant 32>
        unit size <integer_cst 0x4001f060 constant invariant 4>
        align 16 symtab 1074955520 alias set 18
        pointer_to_this <pointer_type 0x4013f740>>
    addressable asm_written used static unsigned SI file /home/peter/work/cvs-gnu/uberbaum/gcc/unwind-dw2-fde.c line 48 size <integer_cst 0x4001f408 32> unit size <integer_cst 0x4001f060 4>
    align 16
    (mem/f/i:SI (reg/f:SI 9 %a1) [18 unseen_objects+0 S4 A16]) chain <var_decl 0x401375e4 seen_objects>>

Back up in assemble_variable where name is set at line 1554 to:

  name = XSTR (XEXP (decl_rtl, 0), 0);

decl_rtl is:

(gdb) call debug_rtx(decl->decl.rtl)
(mem/f/i:SI (reg/f:SI 9 %a1) [18 unseen_objects+0 S4 A16])

where I think this is supposed to be some type of name(from the XSTR) instead of a
memory reference.

I don't have a clue where to look next since I've nevered tinkered
outside of the backend...

-- 
Peter Barada
peter@the-baradas.com



More information about the Gcc-patches mailing list