diff options
| author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-30 17:01:18 +0000 |
|---|---|---|
| committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-30 17:01:18 +0000 |
| commit | 86369aa7bde4e59f48d2cd4a3f2398c488042878 (patch) | |
| tree | f862f637a67c0b3826daf74e6d0df59e36b7417c | |
| parent | 9cf9e3f742b2b6d23fdcf82c37011af1c6e92cde (diff) | |
| download | ppe42-gcc-86369aa7bde4e59f48d2cd4a3f2398c488042878.tar.gz ppe42-gcc-86369aa7bde4e59f48d2cd4a3f2398c488042878.zip | |
2007-04-30 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/31721
* tree.c (reconstruct_complex_type): Reconstruct a reference
correctly.
Also use the same mode for the pointer as the old pointer type.
2007-04-30 Andrew pinski <andrew_pinski@playstation.sony.com>
PR C++/31721
* g++.dg/ext/vector7.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124300 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/ext/vector7.C | 8 | ||||
| -rw-r--r-- | gcc/tree.c | 13 |
4 files changed, 31 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24ff41264da..da8aaf6b53d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-04-30 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR C++/31721 + * tree.c (reconstruct_complex_type): Reconstruct a reference + correctly. + Also use the same mode for the pointer as the old pointer type. + 2007-04-30 Francois-Xavier Coudert <coudert@clipper.ens.fr> * doc/trouble.texi (Interoperation): Remove note about Ultrix diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d9972b7497f..efe44a6e78b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2007-04-29 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> +2007-04-30 Andrew pinski <andrew_pinski@playstation.sony.com> + + PR C++/31721 + * g++.dg/ext/vector7.C: New testcase. + +2007-04-29 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/31591 * gfortran.dg/bound_simplification_1.f90: New test. diff --git a/gcc/testsuite/g++.dg/ext/vector7.C b/gcc/testsuite/g++.dg/ext/vector7.C new file mode 100644 index 00000000000..cd259b1a258 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vector7.C @@ -0,0 +1,8 @@ +// { dg-options "" } +// { dg-do compile } +// PR C++/31721 and PR 14217 +// the attribute vector_size would change a reference type into a pointer type which was wrong. + +#define vector __attribute__((__vector_size__(16) )) +vector int b; +vector int &a = b; diff --git a/gcc/tree.c b/gcc/tree.c index 626f8e447c0..fbaeb737cc8 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -7236,11 +7236,18 @@ tree reconstruct_complex_type (tree type, tree bottom) { tree inner, outer; - - if (POINTER_TYPE_P (type)) + + if (TREE_CODE (type) == POINTER_TYPE) + { + inner = reconstruct_complex_type (TREE_TYPE (type), bottom); + outer = build_pointer_type_for_mode (inner, TYPE_MODE (type), + TYPE_REF_CAN_ALIAS_ALL (type)); + } + else if (TREE_CODE (type) == REFERENCE_TYPE) { inner = reconstruct_complex_type (TREE_TYPE (type), bottom); - outer = build_pointer_type (inner); + outer = build_reference_type_for_mode (inner, TYPE_MODE (type), + TYPE_REF_CAN_ALIAS_ALL (type)); } else if (TREE_CODE (type) == ARRAY_TYPE) { |

