Looks like sometime between Oct27 (http://gcc.gnu.org/ml/gcc-testresults/2006-10/msg01336.html) and Oct30 (http://gcc.gnu.org/ml/gcc-testresults/2006-10/msg01538.html) the fortran vectorizer testcases started ICEing on: gfortran.dg/vect/vect-3.f90:0: warning: 'const' attribute directive ignored gfortran.dg/vect/vect-3.f90:4: internal compiler error: in vect_setup_realignment, at tree-vect-transform.c:2534 Should be related somehow to this code in rs6000.c: /* Initialize target builtin that implements targetm.vectorize.builtin_mask_for_load. */ 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)); Anybody knows which patch caused this?
Dorit, Nothing stands out in the gfortran patches in that interval, although I am not sure what I am looking for. I base my remark on the fact that none of the patches between 10/27 and 10/31 would appear to touch that subroutine. The code generated for vect-3.f90 looks OK, so I would have to suppose that the problem has arisen further downstream. Regards Paul
Actually I think this bug was caused by: 2006-10-23 Rafael Avila de Espindola <rafael.espindola@gmail.com> * tree.c (local_define_builtin): Replace calls to lang_hooks.builtin_function with add_builtin_function. * c-objc-common.h (LANG_HOOKS_BUILTIN_FUNCTION): Define as c_builtin_function. * c-tree.h (builtin_function): Rename to c_builtin_function. Change the signature. * c-decl.c (builtin_function): Rename to c_builtin_function. Move common code to add_builtin_function. ...
*** Bug 29617 has been marked as a duplicate of this bug. ***
I am going to look into this, this weekend and see why that patch caused a difference.
I am going to try to fix this, it blocks my other work on getting altivec builtins marked as const/pure.
This patch should fix the problem: Index: config/rs6000/rs6000.c =================================================================== --- config/rs6000/rs6000.c (revision 118728) +++ config/rs6000/rs6000.c (working copy) @@ -8711,9 +8711,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_READONLY (decl) = 1; /* Record the decl. Will be used by rs6000_builtin_mask_for_load. */ altivec_builtin_mask_for_load = decl; } I don't think we should be using attributes here really.
(In reply to comment #6) > This patch should fix the problem: indeed it does, thanks! are you going to submit it to mainline?
(In reply to comment #7) > indeed it does, thanks! > are you going to submit it to mainline? Should be submitted this weekend, today is a party day for me, launch and all :).
I think this was fixed by: http://gcc.gnu.org/ml/gcc-cvs/2006-11/msg00427.html
(In reply to comment #9) > I think this was fixed by: > http://gcc.gnu.org/ml/gcc-cvs/2006-11/msg00427.html No it was not.
> > I think this was fixed by: > > http://gcc.gnu.org/ml/gcc-cvs/2006-11/msg00427.html > No it was not. Thanks for checking. (This was actually the PR, for which I asked yesterday on IRC whether it was commited or not.) By the way, you wrote 2006-11-17: > Should be submitted this weekend Any new ETA?
> By the way, you wrote 2006-11-17: > > Should be submitted this weekend > Any new ETA? It was already submitted: http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00110.html
Subject: Bug 29779 Author: pinskia Date: Tue Dec 19 08:28:46 2006 New Revision: 120045 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120045 Log: 2006-12-18 Andrew Pinski <pinskia@gmail.com> PR target/29779 * config/rs6000/rs6000.c (altivec_init_builtins): Change to set READONLY on __builtin_altivec_mask_for_load instead of adding the attribute. Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/rs6000.c
Fixed.