This is the mail archive of the
mailing list for the GCC project.
Re: [RFC][PR target/39726 P4 regression] match.pd pattern to do type narrowing
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 2 Feb 2015 16:59:05 +0000
- Subject: Re: [RFC][PR target/39726 P4 regression] match.pd pattern to do type narrowing
- Authentication-results: sourceware.org; auth=none
- References: <54CC560B dot 8080200 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1502010039210 dot 23456 at digraph dot polyomino dot org dot uk> <54CDBDC6 dot 3050000 at redhat dot com>
On Sat, 31 Jan 2015, Jeff Law wrote:
> The nice thing about wrapping the result inside a convert is the types for the
> inner operations will propagate from the type of the inner operands, which is
> exactly what we want. We then remove the hack assigning type and instead the
> original type will be used for the outermost convert.
Those inner operands still need converting to unsigned for arithmetic.
> And FWIW, there's no reason to restrict the pattern to just masking off the
> sign bit. That's what the PR complains about, but we can do considerably
> better here. That's part of the reason why I put in the iterators -- to
> generalize this to more cases.
Well, we want to move shorten_binary_op and shorten_compare to the new
Joseph S. Myers