[PATCH] Start to Fix PR 28436: accessing an element via a "pointer" on a vector does not cause vec_extract to be used
Andrew_Pinski@PlayStation.Sony.Com
Andrew_Pinski@PlayStation.Sony.Com
Tue Dec 12 22:25:00 GMT 2006
Roger Sayle <roger@eyesopen.com> wrote on 12/04/2006 03:35:25 PM:
>
> This is OK for mainline. I agree that this patch should probably have
> been divided into smaller pieces to simplify review, however the
> fold-const.c change is fine, and the majority of the DECL_GIMPLE_REG_P
> clean-up is mechanical and obvious. Hopefully, the SRA folks are happy
> with your bug-fix of using an new is_vector_lhs field. If not I'm sure
> they'll let us know.
This is what I checked in after another bootstrap and test, I had to fix
another vectorizer issue as it was not setting DECL_GIMPLE_REG_P which was
added after I posted my patch.
Thanks,
Andrew Pinski
* tree.h (DECL_COMPLEX_GIMPLE_REG_P): Rename to ...
(DECL_GIMPLE_REG_P): This.
* fold-const.c (fold_indirect_ref_1): Fold *(foo *)&vectorfoo into
using BIT_FIELD_REF.
* omp-low.c (omp_copy_decl_2): Use the renamed DECL_GIMPLE_REG_P.
* tree-gimple.c (is_gimple_reg): Use the renamed DECL_GIMPLE_REG_P
and check for VECTOR_TYPE.
* expr.c (get_inner_reference): Set the mode for BIT_FIELD_REF
with
vector types.
* tree-flow-inline.h (var_can_have_subvars): Use the renamed
DECL_GIMPLE_REG_P.
* gimplify.c (internal_get_tmp_var): Use the renamed
DECL_GIMPLE_REG_P
and check for VECTOR_TYPE.
(gimplify_bind_expr): Likewise.
(gimplify_function_tree): Likewise.
* expmed.c: Include target.h.
(extract_bit_field): For vector mode, try find a better mode
first.
If that fails use gen_lowpart (for vectors only).
* tree-dfa.c (make_rename_temp): Use the renamed DECL_GIMPLE_REG_P
and check for VECTOR_TYPE.
* tree-ssa-pre.c (create_expressions_by_pieces): Likewise.
(insert_into_preds_of_block): Likewise.
(insert_fake_stores): Create gimple register store_tmps for
vector types.
* tree-sra.c (sra_elt): New field, is_vector_lhs.
(sra_walk_expr <case BIT_FIELD_REF>): For vector types that
are the left hand side, set the element's is_vector_lhs to true.
(instantiate_element): For vector types which were on the left
hand size, set DECL_GIMPLE_REG_P to false.
* tree-nested.c (create_tmp_var_for): Use the renamed
DECL_GIMPLE_REG_P.
* tree-inline.c (declare_return_variable): Use the renamed
DECL_GIMPLE_REG_P
and check for VECTOR_TYPE.
(copy_decl_to_var): Use the renamed DECL_GIMPLE_REG_P.
(copy_result_decl_to_var): Likewise.
* tree-vect-transform.c (vect_get_new_vect_var): For vector types,
create a
gimple register variable.
(vect_permute_store_chain): Set DECL_GIMPLE_REG_P to true for the
vect_inter_*
temp variables.
* Makefile.in (expmed.o): Update dependencies.
testsuite/ChangeLog:
* gcc.c-torture/compile/vector-1.c: New test.
* gcc.c-torture/compile/vector-2.c: New test.
* gcc.c-torture/compile/vector-3.c: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixvector.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061212/789e76ff/attachment.txt>
More information about the Gcc-patches
mailing list