This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix target/29779, vectorizer fortran testcases failing
- From: Andrew Pinski <pinskia at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 02 Dec 2006 10:05:03 -0800
- Subject: [PATCH] Fix target/29779, vectorizer fortran testcases failing
Hi,
The problem here is that the handling of the "const" attribute was
removed from the Fortran front-end when the builtin function mechanism
was changed. There are three possibilities on how to fix this bug:
(1) add back the const attribute handling
(2) Change the back-end to use TREE_READONLY instead of adding the
attribute
(3) Add common attribute handling
I went for 2 because it was the easier fix and I see no reason for
back-ends to use attributes when they should know how to set const/pure,
etc. attribute themselves.
OK? Bootstrapped and tested on powerpc-darwin with no regressions.
:ADDPATCH target/PPC:
Thanks,
Andrew Pinski
* config/rs6000/rs6000.c (altivec_init_builtins): Change to set
READONLY on __builtin_altivec_mask_for_load instead of adding
the attribute.
Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c (revision 119245)
+++ config/rs6000/rs6000.c (working copy)
@@ -8765,9 +8765,8 @@ altivec_init_builtins (void)
decl = add_builtin_function ("__builtin_altivec_mask_for_load",
v16qi_ftype_long_pcvoid,
ALTIVEC_BUILTIN_MASK_FOR_LOAD,
- BUILT_IN_MD, NULL,
- tree_cons (get_identifier ("const"),
- NULL_TREE, NULL_TREE));
+ BUILT_IN_MD, NULL, NULL_TREE);
+ TREE_READONLY (decl)
/* Record the decl. Will be used by rs6000_builtin_mask_for_load. */
altivec_builtin_mask_for_load = decl;
}