public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Peter Barada <pbarada@mail.wm.sps.mot.com>
To: Richard.Zidlicky@stud.informatik.uni-erlangen.de
Cc: Peter.Barada@motorola.com, gcc@gcc.gnu.org
Subject: Re: ICE building glibc-2.2.5 using m68k-linux gcc-3.1
Date: Thu, 25 Jul 2002 15:45:00 -0000	[thread overview]
Message-ID: <200207251933.g6PJXKp06132@hyper.wm.sps.mot.com> (raw)
In-Reply-To: <20020725172702.B1938@linux-m68k.org> (message from Richard Zidlicky on Thu, 25 Jul 2002 17:27:02 +0200)


>Btw it does no longer cause an ICE for 3.1.1 but the program from
>which it is taken still doesn't work correctly.
>
>Richard
>
>#### compile with -O0 to trigger ICE ####
>
>extern void (**table)(void);
>
>typedef unsigned short uw16;
>typedef unsigned int gshort;
>
>register uw16 *pc asm("%a4");
>register gshort code asm("%d6");
>
>
>void QMExecuteLoop(uw16 *oldPC)
>{
>            table[code=(*(uw16*)(pc++))]();
>}

This *does* cause an ICE on gcc 3.1.1 20020722 (prerelease):

[pbarada: /tmp] > /tmp/20020722/bin/m68k-linux-gcc -O0 -o /tmp/yy.s -S /tmp/yy.c
/tmp/yy.c: In function `QMExecuteLoop':
/tmp/yy.c:12: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
[pbarada: /tmp] > /tmp/20020722/bin/m68k-linux-gcc -v
Reading specs from /tmp/20020722/lib/gcc-lib/m68k-linux/3.1.1/specs
Configured with: /home/pbarada/work/cvs-wavemark/cross-tools/gcc-20020722/configure --target=m68k-linux --prefix=/tmp/20020722 --enable-languages=c,c++ --with-local-prefix=/tmp/20020722/m68k-linux
Thread model: single
gcc version 3.1.1 20020722 (prerelease)

It blows up in rtx_equal_p with the follwing stack trace:

(gdb) where
#0  rtx_equal_p (x=0x6, y=0x4017bd10)
    at /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-20020722/gcc/rtl.c:510
#1  0x08105788 in add_equal_note (seq=0x4017f9c8, target=0x4017bd10, 
    code=ZERO_EXTEND, op0=0x4017bdc0, op1=0x0)
    at /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-20020722/gcc/optabs.c:143
#2  0x0810954c in emit_unop_insn (icode=454, target=0x4017bd10, 
    op0=0x4017bdc0, code=ZERO_EXTEND)
    at /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-20020722/gcc/optabs.c:2685
#3  0x080ba8ad in convert_move (to=0x4017bd10, from=0x4017bdc0, unsignedp=1)
    at /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-20020722/gcc/expr.c:1060

Note that 'x' is 0x6 in this case and in add_equal_note, 'set' is:

(gdb) call debug_rtx(set)

(set (strict_low_part (reg:HI 6 %d6))
    (reg:HI 30))

(gdb) p set->fld[0].rtx.code
$1 = STRICT_LOW_PART

And at optabs.c:151, the expression:
	  && (GET_CODE (SET_DEST (set)) != STRICT_LOW_PART
	      || ! rtx_equal_p (SUBREG_REG (XEXP (SET_DEST (set), 0)),
				target))))

Is failing since GET_CODE (SET_DEST (set)) == STRICT_LOW_PART, and
SUBREG_REG (XEXP (SET_DEST (set), 0)) is 0x6.  The expression
SUBREG_REG (XEXP (SET_DEST (set), 0)) expands (via cpp) into:

 (((((((((set)->fld[0]).rtx))->fld[0]).rtx))->fld[0]).rtx)

From gdb:

(gdb) call debug_rtx(set)

(set (strict_low_part (reg:HI 6 %d6))
    (reg:HI 30))
(gdb) p set->fld[0].rtx
$16 = 0x4017f9c0
(gdb) p set->fld[0].rtx->fld[0].rtx
$17 = 0x4017be00
(gdb) p set->fld[0].rtx->fld[0].rtx->fld[0].rtx
$18 = 0x6
(gdb) call debug_rtx(set->fld[0].rtx)

(strict_low_part (reg:HI 6 %d6))
(gdb) 

Perhaps the code should be:

	  && (GET_CODE (SET_DEST (set)) != STRICT_LOW_PART
	      || ! rtx_equal_p (SUBREG_REG (SET_DEST (set), 0),
				target))))

which expands into set->fld[0].rtx->fld[0].rtx
And in gdb evauates to:

(gdb) p set->fld[0].rtx->fld[0].rtx
$20 = 0x4017be00
(gdb) call debug_rtx($19)

(reg:HI 6 %d6)

Any ideas???

-- 
Peter Barada                                   Peter.Barada@motorola.com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)

  reply	other threads:[~2002-07-25 19:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-22 17:22 Peter Barada
2002-07-25 13:32 ` Richard Zidlicky
2002-07-25 15:45   ` Peter Barada [this message]
2002-07-26  8:50     ` Richard Henderson
2002-07-26 15:52       ` Richard Zidlicky
2002-07-27 15:18       ` Richard Zidlicky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200207251933.g6PJXKp06132@hyper.wm.sps.mot.com \
    --to=pbarada@mail.wm.sps.mot.com \
    --cc=Peter.Barada@motorola.com \
    --cc=Richard.Zidlicky@stud.informatik.uni-erlangen.de \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).