https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88614

--- Comment #1 from Alan Modra <amodra at gcc dot gnu.org> ---
Author: amodra
Date: Mon Jan  7 22:54:40 2019
New Revision: 267666

URL: https://gcc.gnu.org/viewcvs?rev=267666&root=gcc&view=rev
Log:
genattrtab bit-rot, and if_then_else in values

This patch started off just by adding if_then_else support in
write_attr_value to be able to write a saner expression for powerpc
tls_gdld_nomark length.  Then I noticed bit-rot in functions used to
calculate insn_default_length, insn_min_length, and length_unit_log
(which are used by the shorten_branches pass).  These functions
don't handle a const_int length value and return an "unknown" status
that isn't used, or in the case of or_attr_value, doesn't need to be
used.  min_attr_value also attempts to return INT_MAX for the
unhandled rtl case, but this can get lost in recursive calls.  I fixed
that problem by returning INT_MIN instead, and translating that to
INT_MAX in the only caller of min_attr_value.

        PR target/88614
        * genattrtab.c (max_attr_value, min_attr_value, or_attr_value):
        Delete "unknownp" parameter.  Adjust callers.  Handle
        CONST_INT, PLUS, MINUS, and MULT.
        (attr_value_aligned): Renamed from or_attr_value.
        (min_attr_value): Return INT_MIN for unhandled rtl case..
        (min_fn): ..and translate to INT_MAX here.
        (write_length_unit_log): Modify to cope without "unknown".
        (write_attr_value): Handle IF_THEN_ELSE.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/genattrtab.c

Reply via email to