This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix Alpha vector builtins
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Falk Hueffner" <falk at debian dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Apr 2008 11:56:47 +0200
- Subject: Re: [PATCH] Fix Alpha vector builtins
- References: <20080415094705.GA28447@minet.uni-jena.de>
On Tue, Apr 15, 2008 at 11:47 AM, Falk Hueffner <falk@debian.org> wrote:
> Hi,
>
> more strict checking produced ICEs with Alpha vector builtins such as
> __builtin_alpha_maxsw4:
>
> test.c:7: error: invalid types in nop conversion
> long int
> vector short int
> D.1254 = (long int) D.1253
> test.c:7: internal compiler error: verify_gimple failed
>
> This patch is tested with c,c++,fortran,objc on alphaev68-linux.
> Thanks to Richard Guenther and Andrew Pinski for coming up with the
> fix.
Ok.
Thanks,
Richard.
> 2008-04-15 Falk Hueffner <falk@debian.org>
>
> * config/alpha/alpha.c (alpha_fold_vector_minmax): Use
> fold_build1 (VIEW_CONVERT_EXPR, ...) for conversions.
>
>
> Index: gcc/config/alpha/alpha.c
> ===================================================================
> --- gcc/config/alpha/alpha.c (revision 134257)
> +++ gcc/config/alpha/alpha.c (working copy)
> @@ -6768,10 +6768,10 @@
> static tree
> alpha_fold_vector_minmax (enum tree_code code, tree op[], tree vtype)
> {
> - tree op0 = fold_convert (vtype, op[0]);
> - tree op1 = fold_convert (vtype, op[1]);
> + tree op0 = fold_build1 (VIEW_CONVERT_EXPR, vtype, op[0]);
> + tree op1 = fold_build1 (VIEW_CONVERT_EXPR, vtype, op[1]);
> tree val = fold_build2 (code, vtype, op0, op1);
> - return fold_convert (long_integer_type_node, val);
> + return fold_build1 (VIEW_CONVERT_EXPR, long_integer_type_node, val);
> }
>
> static tree
>