This is the mail archive of the 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]
Other format: [Raw text]

Re: RFA: patch for usage of more accurate live information for the globaland the reload.

Vladimir Makarov wrote:

>	* global.c (global_alloc): Call make_accurate_live_analysis.
>	(record_one_conflict): Remove dead code.
>	(mark_reg_clobber): Remove ATTRIBUTE_UNUSED for parameter data.
>	(bb_info): New structure.
>	(BB_INFO, BB_INFO_BY_INDEX): New macros.
>	(allocate_bb_info, free_bb_info, mark_reg_change,
>	calculate_local_reg_bb_info, set_up_bb_rts_numbers, rpost_cmp,
>	forward_propagate_solution, modify_bb_reg_pav,
>	make_accurate_live_analysis): New functions.

This causes an ICE in gcc.c-torture/compile/980408-1.c on
s390-ibm-linux with -O1:

/home/weigand/fsf/gcc-head/gcc/testsuite/gcc.c-torture/compile/980408-1.c: In function `MinifyImage':
/home/weigand/fsf/gcc-head/gcc/testsuite/gcc.c-torture/compile/980408-1.c:129: error: insn does not satisfy its constraints:
(insn 379 377 769 2 (parallel [
            (set (reg:SI 1 %r1)
                (zero_extend:SI (mem/s/j:HI (reg/v/f:SI 1 %r1 [orig:44 q ] [44]) [0 <variable>.red+0 S2 A16])))
            (clobber (reg:CC 33 %cc))
        ]) 107 {*zero_extendhisi2_31} (nil)
/home/weigand/fsf/gcc-head/gcc/testsuite/gcc.c-torture/compile/980408-1.c:129: internal compiler error: in reload_cse_simplify_operands, at postreload.c:378 

The ICE occurs because an earlyclobber constraint is violated:
(define_insn_and_split "*zero_extendhisi2_31"
  [(set (match_operand:SI 0 "register_operand" "=&d")
        (zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
   (clobber (reg:CC 33))]

This happens because global register allocation assigns hard reg 1 
to the pseudo 44, and reload *also* chooses register 1 as reload
reg for the SET_DEST register of that insn.

Normally, this should not be happening, because reg 44 should be
marked in chain->live_throughout of that insn, which would then
cause reg 1 to be marked as bad_spill_regs in order_regs_for_reload.

However, in this particular test case reg 44 happens to be
uninitialized.  Therefore, make_accurate_live_analysis removes
it from bb->global_live_at_start and it subsequently doesn't
make it into chain->live_throughout ...

Now of course using an uninitialized variable invokes undefined 
behaviour, but I'm not convinced an ICE is the proper reaction ...

Any ideas how to fix this?


  Dr. Ulrich Weigand

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