[PATCH] PR rtl-optimization/37922: Replace read clobbers hard regs.

Kenneth Zadeck zadeck@naturalbridge.com
Wed Dec 17 15:26:00 GMT 2008


Replacing a read with shifting operations in dse.c occasionally uses
instructions that set hard regs (like the CC).  This patch makes sure
that the hard regs set by the new code were not already live.


2008-12-17  Kenneth Zadeck <zadeck@naturalbridge.com>

    PR rtl-optimization/37922
    * dce.c (bb_info): Added regs_live field.
    (look_for_hardregs): New function.
    (replace_read): Added regs_live parameter and code to check that
    shift sequence does not clobber live hardregs.
    (check_mem_read_rtx): Added parameter to replace_read.
    (dse_step1): Added regs_live bitmap and initialize it.
    (rest_of_handle_dse): Added DF_NOTES problem and earlier call to
    df_analyze.
    * df-problems.c (df_simulate_one_insn): Renamed to
    df_simulate_one_insn_backwards.
    (df_simulate_artificial_defs_at_top,
    df_simulate_one_insn_forwards,
    df_simulate_artificial_defs_at_end): New functions.
    * df.h (df_simulate_one_insn): Renamed to
    df_simulate_one_insn_backwards.
    (df_simulate_artificial_defs_at_top,
    df_simulate_one_insn_forwards,
    df_simulate_artificial_defs_at_end): New functions.
    * sel-sched.c (propagate_lv_set): Renamed to
    df_simulate_one_insn_backwards.
    * ifcvt.c (dead_or_predicable): Ditto.
    * recog.c (peephole2_optimize): Ditto.
    * rtl-factoring (collect_pattern_seqs, clear_regs_live_in_seq): Ditto.

2008-12-17  Kenneth Zadeck <zadeck@naturalbridge.com>

    PR rtl-optimization/37922
    * g++.dg/torture/pr37922.C: New test.

Bootstrapped and regression tested on x86-32 and x86-64. 
OK for commit?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dce3.diff
Type: text/x-patch
Size: 25644 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081217/8e62c7dd/attachment.bin>


More information about the Gcc-patches mailing list