diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1992-12-26 22:18:12 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1992-12-26 22:18:12 -0500 |
commit | 66212c2f764860e8b40ec23c1a45b9bf754c5354 (patch) | |
tree | 46d0f6ca70ac5113eabab699d0e4fb4b8f7c7a0e /gcc | |
parent | 0570c42392880a6359ce2bacd928c2a18b0502c2 (diff) | |
download | gcc-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.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -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 |