This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: failuer to build uberbaum --target=m68k-elf
- From: Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>
- To: hp at bitrange dot com
- Cc: peter at baradas dot org, gcc at gcc dot gnu dot org
- Date: Wed, 29 Jan 2003 18:39:58 -0500
- Subject: Re: failuer to build uberbaum --target=m68k-elf
- References: <Pine.BSF.4.44.0212212104140.75377-100000@dair.pair.com>
>On Fri, 20 Dec 2002, Peter Barada wrote:
>> /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/m68000/newlib/ -isystem /home/peter/work/cvs-gnu/obj/m68k-elf/m68000/newlib/targ-include -isystem /home/peter/work/cvs-gnu/uberbaum/newlib/libc/include -B/home/mylocal/uberbaum/m68k-elf/m68k-elf/bin/ -B/home/mylocal/uberbaum/m68k-elf/m68k-elf/lib/ -isystem /home/mylocal/uberbaum/m68k-elf/m68k-elf/include -L/home/peter/work/cvs-gnu/obj/ld -m68000 -DPACKAGE=\"newlib\" -DVERSION=\"1.10.0\" -I. -I/home/peter/work/cvs-gnu/uberbaum/newlib/libm/math -I/home/peter/work/cvs-gnu/uberbaum/newlib/libm/math/../common -O2 -DCOMPACT_CTYPE -DMISSING_SYSCALL_NAMES -fno-builtin -O2 -g -O2 -m68000 -c /home/peter/work/cvs-gnu/uberbaum/newlib/libm/math/kf_cos.c
>> /home/peter/work/cvs-gnu/uberbaum/newlib/libm/math/kf_cos.c: In function `__kernel_cosf':
>> /home/peter/work/cvs-gnu/uberbaum/newlib/libm/math/kf_cos.c:59: internal compiler error: in trunc_int_for_mode, at explow.c:56
>
>> 2) Has *anyone* else seen this?
>
>Also spotted on the 3.3 branch, LAST_UPDATED Tue Dec 17 17:49:08
>GMT 2002
>
>> 3) Any suggestions where I should look from here?
>
>Besides running cc1 in gdb and finding out where the offending
>trunc_int_for_mode call comes from? ;-)
Ok, you asked, here's the scoop. try_combine() is called with:
Breakpoint 5, try_combine (i3=0x400bc9a0, i2=0x400bc91c, i1=0x400bc630,
new_direct_jump_p=0xbfffef98)
at /home/pbarada/work/cvs-gnu/uberbaum/gcc/combine.c:1536
(gdb) call debug_rtx(i3)
(insn 22 21 23 0 0x400bc554 (set (cc0)
(compare (reg/v:SI 37 [ ix ])
(const_int 838860799 [0x31ffffff]))) 11 {*m68k.md:518} (insn_list 20 (nil))
(nil))
(gdb) call debug_rtx(i2)
(insn 20 19 21 0 0x400bc554 (set (reg/v:SI 37 [ ix ])
(and:SI (subreg:SI (reg/v:SF 30 [ x ]) 0)
(const_int 2147483647 [0x7fffffff]))) 177 {andsi3_internal} (insn_list 3 (nil))
(nil))
(gdb) call debug_rtx(i1)
(insn 3 267 4 0 (nil) (set (reg/v:SF 30 [ x ])
(mem/f:SF (plus:SI (reg/f:SI 14 %a6)
(const_int 8 [0x8])) [2 x+0 S4 A16])) 40 {*m68k.md:1097} (nil)
(expr_list:REG_EQUIV (mem/f:SF (plus:SI (reg/f:SI 14 %a6)
(const_int 8 [0x8])) [2 x+0 S4 A16])
(nil)))
And try_combine puts together:
(gdb) call debug_rtx(x)
(and:SF (mem/f:SF (plus:SI (reg/f:SI 14 %a6)
(const_int 8 [0x8])) [2 x+0 S4 A16])
(const_int 2147483647 [0x7fffffff]))
which os passed on to simplify_logical. The callback at the abort is:
(gdb) where
#0 fancy_abort (file=0x8283d80 "/home/pbarada/work/cvs-gnu/uberbaum/gcc/explow.c",
line=56, function=0x8283c90 "trunc_int_for_mode")
at /home/pbarada/work/cvs-gnu/uberbaum/gcc/diagnostic.c:1364
#1 0x080f8d8a in trunc_int_for_mode (c=2147483647, mode=SFmode)
at /home/pbarada/work/cvs-gnu/uberbaum/gcc/explow.c:56
#2 0x08228546 in simplify_and_const_int (x=0x400ded74, mode=SFmode, varop=0x40021e34,
constop=2147483647) at /home/pbarada/work/cvs-gnu/uberbaum/gcc/combine.c:8088
#3 0x082246de in simplify_logical (x=0x400ded74, last=0)
at /home/pbarada/work/cvs-gnu/uberbaum/gcc/combine.c:5418
#4 0x08223004 in combine_simplify_rtx (x=0x400ded74, op0_mode=VOIDmode, last=0,
in_dest=0) at /home/pbarada/work/cvs-gnu/uberbaum/gcc/combine.c:4597
#5 0x08221913 in subst (x=0x400ded74, from=0x4001ffa0, to=0x40021e34, in_dest=0,
unique_copy=0) at /home/pbarada/work/cvs-gnu/uberbaum/gcc/combine.c:3575
#6 0x08221804 in subst (x=0x400ded80, from=0x4001ffa0, to=0x40021e34, in_dest=0,
unique_copy=0) at /home/pbarada/work/cvs-gnu/uberbaum/gcc/combine.c:3526
#7 0x08221804 in subst (x=0x40021ed0, from=0x4001ffa0, to=0x40021e34, in_dest=0,
unique_copy=0) at /home/pbarada/work/cvs-gnu/uberbaum/gcc/combine.c:3526
#8 0x08221804 in subst (x=0x40021edc, from=0x4001ffa0, to=0x40021e34, in_dest=0,
unique_copy=0) at /home/pbarada/work/cvs-gnu/uberbaum/gcc/combine.c:3526
#9 0x0821ed1e in try_combine (i3=0x400bc9a0, i2=0x400bc91c, i1=0x400bc630,
new_direct_jump_p=0xbfffef98)
at /home/pbarada/work/cvs-gnu/uberbaum/gcc/combine.c:1987
So trunc_int_mode() is called from simplify_and_const_int() since the
RTL is an AND(with a constant arg), but with SFmode which causes
trunc_int_mode() to barf.
At the start of simplify_logical(), I added:
/* Can only simplify integer modes */
if (!(GET_MODE_CLASS (mode) == MODE_INT || GET_MODE_CLASS (mode) == MODE_PARTIAL_INT))
return x;
Which forces simplify_logical() to abandon any simplification if the
mode of the expression is not an integer. With this change I was able
to bootstrap gcc-3.2.1 for i686, and using that bootstrapped compiler,
build a --target-m68k-elf toolchain. I've also built an m68k-elf
compiler from the uberbaum tree.
--
Peter Barada Peter.Barada@motorola.com
Wizard 781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola) 781-270-0193 (fax)