diff options
author | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-16 11:47:38 +0000 |
---|---|---|
committer | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-16 11:47:38 +0000 |
commit | 642a9b2dd1805fdbd1c93c448e57bb65466c9956 (patch) | |
tree | 44129ea79537bff2bac935ce4ae073eed0368a02 /gcc/tree-vect-analyze.c | |
parent | 368a5222accbe6129c727422cb27c5ced16c8e14 (diff) | |
download | gcc-642a9b2dd1805fdbd1c93c448e57bb65466c9956.tar.gz |
* tree-vect-analyze.c (vect_enhance_data_refs_alignment): Copy
UNITS_PER_SIMD_WORD to a local variable to avoid a "division by zero"
error.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96552 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-analyze.c')
-rw-r--r-- | gcc/tree-vect-analyze.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index d1b274b56ec..df2e88282cf 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -1013,6 +1013,13 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) struct data_reference *dr0 = NULL; unsigned int i, j; + /* Sigh, a hack to make targets that do not define UNITS_PER_SIMD_WORD + bootstrap. Copy UNITS_PER_SIMD_WORD to a local variable to avoid a + "division by zero" error. This error would be issued because we + we do "... % UNITS_PER_SIMD_WORD" below, and UNITS_PER_SIMD_WORD + defaults to 0 if it is not defined by the target. */ + int units_per_simd_word = UNITS_PER_SIMD_WORD; + /* This pass will require a cost model to guide it whether to apply peeling or versioning or a combination of the two. For example, the scheme that @@ -1167,7 +1174,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) int drsize = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (DR_REF (dr)))); DR_MISALIGNMENT (dr) += npeel * drsize; - DR_MISALIGNMENT (dr) %= UNITS_PER_SIMD_WORD; + DR_MISALIGNMENT (dr) %= units_per_simd_word; } else DR_MISALIGNMENT (dr) = -1; |