diff options
author | Andrew Pinski <pinskia@gcc.gnu.org> | 2004-01-17 10:59:46 -0800 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2004-01-17 10:59:46 -0800 |
commit | 6f27961ac09c0d0dfc57b210fcaa15210f49790f (patch) | |
tree | 797d483a650f735ac28f26ffd511461efc40088f /gcc | |
parent | aeeb0e1b8caa1f35a8496de2bcadb2128c287a9f (diff) | |
download | gcc-6f27961ac09c0d0dfc57b210fcaa15210f49790f.zip gcc-6f27961ac09c0d0dfc57b210fcaa15210f49790f.tar.gz gcc-6f27961ac09c0d0dfc57b210fcaa15210f49790f.tar.bz2 |
[multiple changes]
2004-01-16 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/11895
* g++.dg/ext/vector1.C: New test.
2003-08-26 Fred Fish <fnf@intrinsity.com>
PR c++/11895
* decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
except don't call array_type_nelts() with a VECTOR_TYPE.
From-SVN: r76038
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/vector1.C | 5 |
4 files changed, 18 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fb2b43d..eb8d8ee 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-08-26 Fred Fish <fnf@intrinsity.com> + + PR c++/11895 + * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE, + except don't call array_type_nelts() with a VECTOR_TYPE. + 2004-01-16 Jan Hubicka <jh@suse.cz> * mangle.c (write_mangled_name): Remove inline modifier. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b95cf1e..db93277 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4330,14 +4330,14 @@ reshape_init (tree type, tree *initp) } } } - else if (TREE_CODE (type) == ARRAY_TYPE) + else if ((TREE_CODE (type) == ARRAY_TYPE)|| (TREE_CODE (type) == VECTOR_TYPE)) { tree index; tree max_index; /* If the bound of the array is known, take no more initializers than are allowed. */ - max_index = (TYPE_DOMAIN (type) + max_index = ((TYPE_DOMAIN (type) && (TREE_CODE (type) == ARRAY_TYPE)) ? array_type_nelts (type) : NULL_TREE); /* Loop through the array elements, gathering initializers. */ for (index = size_zero_node; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bb7015e..cae7d11 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-01-16 Andrew Pinski <pinskia@physics.uc.edu> + + PR c++/11895 + * g++.dg/ext/vector1.C: New test. + 2004-01-16 Geoffrey Keating <geoffk@apple.com> * gcc.dg/pch/import-1.c: New. diff --git a/gcc/testsuite/g++.dg/ext/vector1.C b/gcc/testsuite/g++.dg/ext/vector1.C new file mode 100644 index 0000000..c6f0e04 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vector1.C @@ -0,0 +1,5 @@ +// PR c++/11895 +// This used to ICE in reshape_init. +// testcase from fnf@ninemoons.com + + __attribute__((vector_size(16))) int a1 = { 100, 200, 300, 400 }; |