diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2001-11-28 12:21:07 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2001-11-28 07:21:07 -0500 |
commit | 3874585e2e5521585d1733f177c25a5a0e224142 (patch) | |
tree | 7f69598c8d9e75767d6a7fc9fd507ca3e7686a08 /gcc/stor-layout.c | |
parent | d6d709cdb5c2ece5e682c97271b6c82a949c1330 (diff) | |
download | gcc-3874585e2e5521585d1733f177c25a5a0e224142.zip gcc-3874585e2e5521585d1733f177c25a5a0e224142.tar.gz gcc-3874585e2e5521585d1733f177c25a5a0e224142.tar.bz2 |
stor-layout.c (put_pending_size): Look for SAVE_EXPR if not at top level; only add to pending_sizes if find it.
* stor-layout.c (put_pending_size): Look for SAVE_EXPR if not at top
level; only add to pending_sizes if find it.
From-SVN: r47415
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index e16045f..e4d8744 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -114,7 +114,15 @@ void put_pending_size (expr) tree expr; { - pending_sizes = tree_cons (NULL_TREE, expr, pending_sizes); + /* Strip any simple arithmetic from EXPR to see if it has an underlying + SAVE_EXPR. */ + while (TREE_CODE_CLASS (TREE_CODE (expr)) == '1' + || (TREE_CODE_CLASS (TREE_CODE (expr)) == '2' + && TREE_CONSTANT (TREE_OPERAND (expr, 1)))) + expr = TREE_OPERAND (expr, 0); + + if (TREE_CODE (expr) == SAVE_EXPR) + pending_sizes = tree_cons (NULL_TREE, expr, pending_sizes); } /* Put a chain of objects into the pending sizes list, which must be |