This is the mail archive of the gcc-bugs@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]

Re: ICE in commit_one_edge_insertion, at flow.c:2467


> The following bootstrap error occured near the end of stage2 with todays
> mainline under hppa1.1-hp-hpux10.20:
> 
> ./xgcc -B./ -B/usr/local/hppa1.1-hp-hpux10.20/bin/ -isystem /usr/local/hppa1.1-hp-hpux10.20/include -O2   -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/config -I../../gcc/../include -DUSE_COLLECT2 -DL_muldi3 -c ../../gcc/libgcc2.c -o libgcc/./_muldi3.o
> ../../gcc/libgcc2.c: In function `__muldi3':
> ../../gcc/libgcc2.c:367: Internal compiler error in commit_one_edge_insertion, at flow.c:2467

Here is more info on the problem.  The function returnjump_p_1 is being
miscompiled by the stage 1 compiler.  This small test program will demonstrate
the problem:

#include "config.h"
#include "system.h"
#include "rtl.h"

static int
returnjump_p_1 (loc, data)
     rtx *loc;
     void *data ATTRIBUTE_UNUSED;
{
  rtx x = *loc;
  return x && GET_CODE (x) == RETURN;
}

int
returnjump_p (insn)
     rtx insn;
{
  if (GET_CODE (insn) != JUMP_INSN)
    return 0;
  return for_each_rtx (&PATTERN (insn), returnjump_p_1, NULL);
}

Here is the assembler code for returnjump_p_1:

returnjump_p_1
	.PROC
	.CALLINFO FRAME=0,NO_CALLS
	.ENTRY
	ldw 0(%r26),%r26
	comib,= 0,%r26,L$0002
	ldi 0,%r28
	ldh 0(%r26),%r19
	comclr,<> %r20,%r19,%r28
	ldi 1,%r28
L$0002
	bv,n %r0(%r2)
	.EXIT
	.PROCEND

As can be seen, the "RETURN" compare has disappeared.  This is the
initial rtl for the compare:

;; Function returnjump_p_1

[deleted]

(insn 22 21 24 (set (reg:SI 100)
        (zero_extend:SI (reg:HI 99))) -1 (nil)
    (nil))

(insn 24 22 25 (set (reg:SI 101)
        (const_int 49 [0x31])) -1 (nil)
    (nil))

(jump_insn 25 24 27 (set (pc)
        (if_then_else (ne (reg:SI 100)
                (reg:SI 101))
            (label_ref 28)
            (pc))) -1 (nil)
    (nil))

(insn 27 25 28 (set (reg:SI 98)
        (const_int 1 [0x1])) -1 (nil)
    (nil))

(code_label 28 27 30 2 "" "" [0 uses])

After the jump pass, we get:

;; Function returnjump_p_1

try_optimize_cfg iteration 1

try_optimize_cfg iteration 1

IF-THEN block found, start 1, then 2, join 3
Conversion succeeded.

1 possible IF blocks searched.
1 IF blocks converted.
1 basic blocks deleted.

[deleted]

(insn 22 21 49 (set (reg:SI 100)
        (zero_extend:SI (reg:HI 99))) -1 (nil)
    (nil))

(insn 49 22 24 (set (reg:SI 98)
        (if_then_else:SI (ne (reg:SI 100)
                (reg:SI 101))
            (reg:SI 98)
            (const_int 1 [0x1]))) -1 (nil)
    (nil))

(insn 24 49 28 (set (reg:SI 101)
        (const_int 49 [0x31])) -1 (nil)
    (nil))

(code_label 28 24 45 2 "" "" [1 uses])

Somehow the compare (insn 49) has been pushed ahead of the set for reg:SI 101.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


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