diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1997-03-17 16:29:33 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1997-03-17 16:29:33 -0500 |
commit | 0fd17968072d1cc7d6b3b4a8a5616faa8c984c26 (patch) | |
tree | 5901ab0332717631dc1d6beacbe000ffacc6d49f /gcc/tree.c | |
parent | d5afd1d10bc39a4c56e0591554ab39063fa54341 (diff) | |
download | gcc-0fd17968072d1cc7d6b3b4a8a5616faa8c984c26.zip gcc-0fd17968072d1cc7d6b3b4a8a5616faa8c984c26.tar.gz gcc-0fd17968072d1cc7d6b3b4a8a5616faa8c984c26.tar.bz2 |
(build_{index,range}_type): Ensure expressions for min and max value
are in same obstack as type.
From-SVN: r13722
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -3801,10 +3801,14 @@ build_index_type (maxval) tree maxval; { register tree itype = make_node (INTEGER_TYPE); + TYPE_PRECISION (itype) = TYPE_PRECISION (sizetype); - TYPE_MIN_VALUE (itype) = build_int_2 (0, 0); - TREE_TYPE (TYPE_MIN_VALUE (itype)) = sizetype; + TYPE_MIN_VALUE (itype) = size_zero_node; + + push_obstacks (TYPE_OBSTACK (itype), TYPE_OBSTACK (itype)); TYPE_MAX_VALUE (itype) = convert (sizetype, maxval); + pop_obstacks (); + TYPE_MODE (itype) = TYPE_MODE (sizetype); TYPE_SIZE (itype) = TYPE_SIZE (sizetype); TYPE_ALIGN (itype) = TYPE_ALIGN (sizetype); @@ -3834,12 +3838,17 @@ build_range_type (type, lowval, highval) tree type, lowval, highval; { register tree itype = make_node (INTEGER_TYPE); + TREE_TYPE (itype) = type; if (type == NULL_TREE) type = sizetype; - TYPE_PRECISION (itype) = TYPE_PRECISION (type); + + push_obstacks (TYPE_OBSTACK (itype), TYPE_OBSTACK (itype)); TYPE_MIN_VALUE (itype) = convert (type, lowval); TYPE_MAX_VALUE (itype) = convert (type, highval); + pop_obstacks (); + + TYPE_PRECISION (itype) = TYPE_PRECISION (type); TYPE_MODE (itype) = TYPE_MODE (type); TYPE_SIZE (itype) = TYPE_SIZE (type); TYPE_ALIGN (itype) = TYPE_ALIGN (type); |