diff options
author | Richard Guenther <rguenther@suse.de> | 2010-03-22 12:39:04 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-03-22 12:39:04 +0000 |
commit | 6d7971b832cbd7046e04184bbf140d9e6c30ff18 (patch) | |
tree | 7615d605a2a8dda90f867bb37bdebf022984f960 /gcc | |
parent | 6af84c851dbd4c53711ac9f5ed2147bdb29354f6 (diff) | |
download | gcc-6d7971b832cbd7046e04184bbf140d9e6c30ff18.zip gcc-6d7971b832cbd7046e04184bbf140d9e6c30ff18.tar.gz gcc-6d7971b832cbd7046e04184bbf140d9e6c30ff18.tar.bz2 |
re PR middle-end/43390 (ICE: integral result type precision does not match field size of BIT_FIELD_REF)
2010-03-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43390
* tree-vect-stmts.c (get_vectype_for_scalar_type): Make
sure vector extracts are type correct.
* gfortran.fortran-torture/execute/pr43390.f90: New testcase.
From-SVN: r157624
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90 | 9 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.c | 8 |
4 files changed, 28 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 077b6e6..5cff766 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2010-03-22 Richard Guenther <rguenther@suse.de> + PR tree-optimization/43390 + * tree-vect-stmts.c (get_vectype_for_scalar_type): Make + sure vector extracts are type correct. + +2010-03-22 Richard Guenther <rguenther@suse.de> + PR middle-end/40106 * builtins.c (expand_builtin_pow): Expand pow (x, 1.5) as x * sqrt (x) even when optimizing for size if the target diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 73e978a..a036f25 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-03-22 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/43390 + * gfortran.fortran-torture/execute/pr43390.f90: New testcase. + 2010-03-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * gcc.target/powerpc/ppc-sdata-1.c: Require nonpic. diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90 new file mode 100644 index 0000000..b54eef9 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/pr43390.f90 @@ -0,0 +1,9 @@ + logical :: l1(4) + logical :: l2(4) + l1 = (/.TRUE.,.FALSE.,.TRUE.,.FALSE./) + l2 = (/.FALSE.,.TRUE.,.FALSE.,.TRUE./) + if (dot_product (l1, l2)) call abort () + l2 = .TRUE. + if (.not.dot_product (l1, l2)) call abort () +end + diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index ce604b3..4bce61a 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -4417,6 +4417,14 @@ get_vectype_for_scalar_type (tree scalar_type) if (nbytes < TYPE_ALIGN_UNIT (scalar_type)) return NULL_TREE; + /* If we'd build a vector type of elements whose mode precision doesn't + match their types precision we'll get mismatched types on vector + extracts via BIT_FIELD_REFs. This effectively means we disable + vectorization of bool and/or enum types in some languages. */ + if (INTEGRAL_TYPE_P (scalar_type) + && GET_MODE_BITSIZE (inner_mode) != TYPE_PRECISION (scalar_type)) + return NULL_TREE; + /* FORNOW: Only a single vector size per mode (UNITS_PER_SIMD_WORD) is expected. */ nunits = UNITS_PER_SIMD_WORD (inner_mode) / nbytes; |