This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Relax VIEW_CONVERT_EXPR - CONVERT_EXPR combination
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 24 May 2017 10:57:19 +0200
- Subject: Re: Relax VIEW_CONVERT_EXPR - CONVERT_EXPR combination
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.02.1705212313230.2140@stedding.saclay.inria.fr>
On Sun, May 21, 2017 at 11:21 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> Hello,
>
> SRA uses char when scalarizing bool, and we end up with
>
> _6 = u_1(D) == 0.0;
> _7 = (unsigned char) _6;
> _3 = VIEW_CONVERT_EXPR<_Bool>(_7);
>
> which we currently do not simplify. I am not completely sure what happens
> with types whose precision does not cover their size, I hope this is safe.
Hmm, if zero-extension is safe so should sign-extension, no? Because
if size != precision then both can actually change bits outside of the
precision?
I realize zero-extension is "safer" in some sense as the extended value
is the same for all precisions.
Thus OK.
thanks,
Richard.
> Bootstrap+testsuite on powerpc64le-unknown-linux-gnu.
>
> 2017-05-22 Marc Glisse <marc.glisse@inria.fr>
>
> gcc/
> * match.pd (view_convert (convert@0 @1)): Handle zero-extension.
>
> gcc/testsuite/
> * gcc.dg/tree-ssa/vce-1.c: New file.
>
> --
> Marc Glisse