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

patch to fix PR55154


The following patch fixes

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55154

The insn in question has 2 alternatives. The first alternative is rejected because operand constraint is class containing non-allocated hard reg for given options. The second alternative was rejected by LRA as the maximal cost was achieved. Reload sets up to close to maximal cost when it sees ! and this is the last operand (imho setting to max reject in reload is wrong as if ! were in the 1st operand, reload would also reject the alternative). LRA accumulates the costs and with reloads of previous operands it easily achieved maximal cost. The patch affects a sensible code of LRA and therefore was rigorously tested.

The patch was successfully bootstrapped and tested on x86/x86-64.

Committed as rev. 193364.

2012-11-09 Vladimir Makarov <vmakarov@redhat.com>

        PR tree-optimization/55154
        * lra-int.h (LRA_LOSER_COST_FACTOR, LRA_MAX_REJECT): New macros.
        * lra.c (setup_operand_alternative): Use them.
        * lra-constraints.c (LOSER_COST_FACTOR, MAX_OVERALL_COST_BOUND):
        Remove.
        (process_alt_operands): Use LRA_LOSER_COST_FACTOR and
        LRA_MAX_REJECT.  Accumulate reject instead of setting for
        non-const.
        (curr_insn_transform): Initialize best_losers and best_overall by
        INT_MAX.

2012-11-09 Vladimir Makarov <vmakarov@redhat.com>

        PR rtl-optimization/55154
        * gcc.target/i386/pr55154.c: New test.

Attachment: pr55154.patch
Description: Text document


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