diff options
author | Richard Biener <rguenther@suse.de> | 2015-10-27 13:48:15 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-10-27 13:48:15 +0000 |
commit | 23a372296360f366e385c187c70a34b97cede2ab (patch) | |
tree | dfcea40f6c79636f4f3b24778642a5a745689386 | |
parent | 1e44e857e05c165f6f01aeb56a7a43ee765bfc99 (diff) | |
download | gcc-23a372296360f366e385c187c70a34b97cede2ab.zip gcc-23a372296360f366e385c187c70a34b97cede2ab.tar.gz gcc-23a372296360f366e385c187c70a34b97cede2ab.tar.bz2 |
re PR tree-optimization/68104 (ice in vect_update_misalignment_for_peel with -O3)
2015-10-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/68104
* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Move
strided access check ...
(vect_compute_data_refs_alignment): ... here.
* gcc.dg/torture/pr68104.c: New testcase.
From-SVN: r229440
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr68104.c | 22 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 39 |
4 files changed, 55 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 80045dd..9659978 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-10-27 Richard Biener <rguenther@suse.de> + + PR tree-optimization/68104 + * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Move + strided access check ... + (vect_compute_data_refs_alignment): ... here. + 2015-10-27 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> Mark Shinwell <shinwell@codesourcery.com> diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e693063..bcadb0c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-10-27 Richard Biener <rguenther@suse.de> + + PR tree-optimization/68104 + * gcc.dg/torture/pr68104.c: New testcase. + 2015-10-27 Alan Lawrence <alan.lawrence@arm.com> * gcc.dg/vect/vect-strided-shift-1.c: New. diff --git a/gcc/testsuite/gcc.dg/torture/pr68104.c b/gcc/testsuite/gcc.dg/torture/pr68104.c new file mode 100644 index 0000000..5db0282 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr68104.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ + +typedef struct +{ + char vl; + char weight; +} ib_vl_arb_element_t; +typedef struct { ib_vl_arb_element_t vl_entry[32]; } ib_vl_arb_table_t; +typedef enum { IB_SUCCESS } ib_api_status_t; +int a, b, d; +char c; +void fn1(); +ib_api_status_t fn2() +{ + int e = b; + ib_vl_arb_table_t f; + if (e) + for (a = 0; a < d; a++) + f.vl_entry[a].vl &= c; + fn1(f); + return IB_SUCCESS; +} diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index b3ca9d6..51cea9e 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -629,12 +629,6 @@ vect_compute_data_ref_alignment (struct data_reference *dr) /* Initialize misalignment to unknown. */ SET_DR_MISALIGNMENT (dr, -1); - /* Strided accesses perform only component accesses, misalignment information - is irrelevant for them. */ - if (STMT_VINFO_STRIDED_P (stmt_info) - && !STMT_VINFO_GROUPED_ACCESS (stmt_info)) - return true; - if (tree_fits_shwi_p (DR_STEP (dr))) misalign = DR_INIT (dr); aligned_to = DR_ALIGNED_TO (dr); @@ -794,18 +788,27 @@ vect_compute_data_refs_alignment (vec_info *vinfo) unsigned int i; FOR_EACH_VEC_ELT (datarefs, i, dr) - if (STMT_VINFO_VECTORIZABLE (vinfo_for_stmt (DR_STMT (dr))) - && !vect_compute_data_ref_alignment (dr)) - { - if (is_a <bb_vec_info> (vinfo)) - { - /* Mark unsupported statement as unvectorizable. */ - STMT_VINFO_VECTORIZABLE (vinfo_for_stmt (DR_STMT (dr))) = false; - continue; - } - else - return false; - } + { + stmt_vec_info stmt_info = vinfo_for_stmt (DR_STMT (dr)); + if (STMT_VINFO_VECTORIZABLE (stmt_info) + && !vect_compute_data_ref_alignment (dr)) + { + /* Strided accesses perform only component accesses, misalignment + information is irrelevant for them. */ + if (STMT_VINFO_STRIDED_P (stmt_info) + && !STMT_VINFO_GROUPED_ACCESS (stmt_info)) + continue; + + if (is_a <bb_vec_info> (vinfo)) + { + /* Mark unsupported statement as unvectorizable. */ + STMT_VINFO_VECTORIZABLE (vinfo_for_stmt (DR_STMT (dr))) = false; + continue; + } + else + return false; + } + } return true; } |