middle-end: Remove truly_noop_truncation check from convert.c
authorRoger Sayle <roger@nextmovesoftware.com>
Mon, 13 Jul 2020 08:49:34 +0000 (09:49 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Mon, 13 Jul 2020 08:49:34 +0000 (09:49 +0100)
commitb8697d0cd06da3375063295fe7161671e0904459
tree2f0cef4cf9cb0bcd555a34db38e759d880e75825
parent9a2ae08b02d185a11e3e525e100ba637ce81c7ff
middle-end: Remove truly_noop_truncation check from convert.c

This patch eliminates a check of targetm.truly_noop_truncation from
the early middle-end, where the gimple/generic being generated by
GCC's front-ends is being inappropriately influenced by the target's
TRULY_NOOP_TRUNCATION.  The (recent) intention of TRULY_NOOP_TRUNCATION
is to indicate that a backend requires explicit truncation instructions
rather than using SUBREGs to perform truncations.  A long standing
(and probably unintentional) side-effect has been that this setting
also controls whether the middle-end narrows integer operations at
the tree-level.  Understandably, GCC and its testsuite assume that
GIMPLE and GENERIC behave consistently across platforms, and alas
defining TRULY_NOOP_TRUNCATION away from the default triggers several
regressions (including gcc.dg/fold-rotate-1.c).

2020-07-13  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* convert.c (convert_to_integer_1): Narrow integer operations
even on targets that require explicit truncation instructions.
gcc/convert.c