problem with regrename pass on c4x

Herman ten Brugge Haj.Ten.Brugge@net.HCC.nl
Sat Dec 9 00:18:00 GMT 2000


Hello,

I have a problem with the regrename pass on the c4x. The code:

struct s
{
  unsigned a : 8;
  unsigned b : 8;
  unsigned c : 8;
  unsigned d : 8;
};

struct s
foo (struct s s, int i)
{
  s.b = i;
  return s;
}

Compiled with -O3 generates a core dump:
b2.c: In function `foo':
b2.c:16: Internal compiler error in print_rtl_and_abort, at flow.c:6335

The problem is that the regrename pass renames a register and flow
detects that live_at_start is not the same anymore.
The debug dump from the regrename pass is at the end. Register r1 is renamed
into r3 for insn 13 and old global_live_at_start = { 2 10 11 20 } and
new_live_at_start = { 2 3 10 11 20 }.
Old global_live_at_start and new_live_at_start are not the same (r3 is
also live now) and this causes the core dump.
Do we do something wrong for the c4x target or is there a bug in the
regrename pass?

	Herman.



;; Function foo


Basic block 0:
Closing chain r0 at insn 13 (terminate_dead)
Closing chain r1 at insn 18 (terminate_dead)
Closing chain r1 at insn 18 (terminate_dead)
Discarding chain r0 at insn 25 (terminate_all_read)
Register r1 (1): 4 [EXT_REGS]
Register r1 (1): 18 [GENERAL_REGS] 13 [EXT_REGS]
Register r0 (1): 13 [GENERAL_REGS] 6 [EXT_REGS]
Register r1 in insn 13, renamed as r3

live_at_start mismatch in bb 0, aborting

first = 0x8284c2c current = 0x8284c2c indx = 0
	0x8284c2c next = (nil) prev = (nil) indx = 0
		bits = { 2 10 11 20 }

first = 0x8284c18 current = 0x8284c18 indx = 0
	0x8284c18 next = (nil) prev = (nil) indx = 0
		bits = { 2 3 10 11 20 }
(note 2 0 26 NOTE_INSN_DELETED -1347440721)

;; Start of basic block 0, registers live: 2 [r2] 10 [ar2] 11 [ar3] 20 [sp]
(note 26 2 30 [bb 0] NOTE_INSN_BASIC_BLOCK -1347440721)

(note 30 26 4 NOTE_INSN_PROLOGUE_END -1347440721)

(insn 4 30 6 (set (reg/v:QI 1 r1)
        (reg:QI 10 ar2)) 8 {movqi_noclobber} (nil)
    (expr_list:REG_DEAD (reg:QI 10 ar2)
        (expr_list:REG_UNUSED (reg/v:QI 1 r1)
            (nil))))

(insn 6 4 7 (set (reg/v:QI 0 r0)
        (reg:QI 2 r2)) 8 {movqi_noclobber} (nil)
    (expr_list:REG_DEAD (reg:QI 2 r2)
        (nil)))

(note 7 6 13 NOTE_INSN_FUNCTION_BEG -1347440721)

(insn 13 7 18 (parallel[ 
            (set (zero_extract:QI (reg:QI 3 r3)
                    (const_int 8 [08h])
                    (const_int 8 [08h]))
                (reg/v:QI 0 r0))
            (clobber (reg:CC 21 st))
        ] ) 103 {*insv_clobber} (insn_list 4 (insn_list 6 (insn_list 4 (insn_list 6 (nil)))))
    (expr_list:REG_DEAD (reg/v:QI 0 r0)
        (expr_list:REG_UNUSED (reg:CC 21 st)
            (nil))))

(insn 18 13 25 (set (reg/i:QI 0 r0)
        (reg:QI 3 r3)) 8 {movqi_noclobber} (insn_list 13 (insn_list 13 (nil)))
    (expr_list:REG_DEAD (reg:QI 3 r3)
        (nil)))

(insn 25 18 31 (use (reg/i:QI 0 r0)) -1 (insn_list 18 (insn_list 18 (nil)))
    (nil))

(note 31 25 32 NOTE_INSN_EPILOGUE_BEG -1347440721)

(jump_insn/f 32 31 33 (return) 182 {return} (nil)
    (nil))
;; End of basic block 0, registers live:
 0 [r0] 11 [ar3] 20 [sp]

(barrier 33 32 29)

(note 29 33 0 NOTE_INSN_DELETED -1347440721)



More information about the Gcc-bugs mailing list