[PATCH] Fix Alpha vector builtins
Falk Hueffner
falk@debian.org
Tue Apr 15 10:14:00 GMT 2008
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.
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
More information about the Gcc-patches
mailing list