On Tue, Nov 17, 2020 at 8:46 AM Jakub Jelinek via Gcc-patches < gcc-patches@gcc.gnu.org> wrote:
> On Tue, Nov 17, 2020 at 05:29:57PM +0100, Philipp Tomsich wrote: > > > > In other words, the change to VRP canonicalizes what a lshift_expr > with an > > > > shift-amount outside of the type width means... it doesn't assume > anything > > > > about the original language. > > Well, I said if we want to do it at all, it should be done in VRP, because > there is not really a difference between ((int) x) << 32 and ((int) x) << y > for y in [32, 137] etc. > How does this stuff interact with SHIFT_COUNT_TRUNCATED and TARGET_SHIFT_TRUNCATION_MASK? We already provide a mechanism to truncate shift counts to fit based on how the hardware handles out-of-range shift counts. Handling out-of-range shift counts differently in VRP would confuse things. Maybe VRP should be using SHIFT_COUNT_TRUCNATED and/or TARGET_SHIFT_TRUNCATION_MASK here? Or maybe we give up on the shift truncation macros? Jim