aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1992-12-26 22:18:12 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1992-12-26 22:18:12 -0500
commit66212c2f764860e8b40ec23c1a45b9bf754c5354 (patch)
tree46d0f6ca70ac5113eabab699d0e4fb4b8f7c7a0e /gcc
parent0570c42392880a6359ce2bacd928c2a18b0502c2 (diff)
downloadgcc-66212c2f764860e8b40ec23c1a45b9bf754c5354.zip
gcc-66212c2f764860e8b40ec23c1a45b9bf754c5354.tar.gz
gcc-66212c2f764860e8b40ec23c1a45b9bf754c5354.tar.bz2
(make_node, case 'c'): For INTEGER_CST, use size of struct containing constant, just like for reals.
(make_node, case 'c'): For INTEGER_CST, use size of struct containing constant, just like for reals. Also, clean up code to avoid confusing fallthrough. From-SVN: r2919
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 98c06bd..3ce46f6 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -844,13 +844,21 @@ make_node (code)
kind = c_kind;
#endif
obstack = expression_obstack;
- /* We can't use tree_code_length for this, since the number of words
- is machine-dependent due to varying alignment of `double'. */
- if (code == REAL_CST)
- {
- length = sizeof (struct tree_real_cst);
- break;
- }
+
+ /* We can't use tree_code_length for INTEGER_CST, since the number of
+ words is machine-dependent due to varying length of HOST_WIDE_INT,
+ which might be wider than a pointer (e.g., long long). Similarly
+ for REAL_CST, since the number of words is machine-dependent due
+ to varying size and alignment of `double'. */
+
+ if (code == INTEGER_CST)
+ length = sizeof (struct tree_int_cst);
+ else if (code == REAL_CST)
+ length = sizeof (struct tree_real_cst);
+ else
+ length = sizeof (struct tree_common)
+ + tree_code_length[(int) code] * sizeof (char *);
+ break;
case 'x': /* something random, like an identifier. */
#ifdef GATHER_STATISTICS