genattrtab bit-rot, and if_then_else in values
commit2d8d93c783dd43769075fa0474d670f6fb4a85f1
authorAlan Modra <amodra@gmail.com>
Mon, 7 Jan 2019 22:54:40 +0000 (8 09:24 +1030)
committerAlan Modra <amodra@gcc.gnu.org>
Mon, 7 Jan 2019 22:54:40 +0000 (8 09:24 +1030)
tree04317764b127d1d3db9709771cee17d5370e8017
parent65c5b1eb85f8f0f3078f614d549f107ee9a001af
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.

From-SVN: r267666
gcc/ChangeLog
gcc/genattrtab.c