diff options
author | Richard Guenther <rguenther@suse.de> | 2008-10-22 17:40:29 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-10-22 17:40:29 +0000 |
commit | 51c869cac9a2b641ee21172ea193eadef9b1f476 (patch) | |
tree | a8b70739be04da68b2f0658cded9a97e965873d3 /gcc | |
parent | a7da8b427fa7de6a459a0a3b33eca9de953aea62 (diff) | |
download | gcc-51c869cac9a2b641ee21172ea193eadef9b1f476.zip gcc-51c869cac9a2b641ee21172ea193eadef9b1f476.tar.gz gcc-51c869cac9a2b641ee21172ea193eadef9b1f476.tar.bz2 |
tree.def (COMPLEX_TYPE): Constrain element type.
2008-10-22 Richard Guenther <rguenther@suse.de>
* tree.def (COMPLEX_TYPE): Constrain element type.
* tree.c (build_complex_type): Assert that.
* tree-ssa-structalias.c (could_have_pointers): Complex types
cannot have pointers.
From-SVN: r141299
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-ssa-structalias.c | 3 | ||||
-rw-r--r-- | gcc/tree.c | 4 | ||||
-rw-r--r-- | gcc/tree.def | 3 |
4 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7e72bca..484e340 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-10-22 Richard Guenther <rguenther@suse.de> + + * tree.def (COMPLEX_TYPE): Constrain element type. + * tree.c (build_complex_type): Assert that. + * tree-ssa-structalias.c (could_have_pointers): Complex types + cannot have pointers. + 2008-10-22 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/30949 diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 6db8298..11427ec 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2765,8 +2765,7 @@ could_have_pointers (tree t) tree type = TREE_TYPE (t); if (POINTER_TYPE_P (type) - || AGGREGATE_TYPE_P (type) - || TREE_CODE (type) == COMPLEX_TYPE) + || AGGREGATE_TYPE_P (type)) return true; return false; @@ -6168,6 +6168,10 @@ build_complex_type (tree component_type) tree t; hashval_t hashcode; + gcc_assert (INTEGRAL_TYPE_P (component_type) + || SCALAR_FLOAT_TYPE_P (component_type) + || FIXED_POINT_TYPE_P (component_type)); + /* Make a node of the sort we want. */ t = make_node (COMPLEX_TYPE); diff --git a/gcc/tree.def b/gcc/tree.def index bde59b7..3e077cc 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -186,7 +186,8 @@ DEFTREECODE (REFERENCE_TYPE, "reference_type", tcc_type, 0) compiler. COMPLEX_TYPE, VECTOR_TYPE, ARRAY_TYPE. */ /* Complex number types. The TREE_TYPE field is the data type - of the real and imaginary parts. */ + of the real and imaginary parts. It must be of scalar + arithmetic type, not including pointer type. */ DEFTREECODE (COMPLEX_TYPE, "complex_type", tcc_type, 0) /* Vector types. The TREE_TYPE field is the data type of the vector |