diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2001-02-14 08:57:49 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2001-02-14 08:57:49 +0100 |
commit | fe375cf108993c9afcef778e4b2def2ddf43160e (patch) | |
tree | 1998ac8deccf251adebd1cb63da29b3285bdd37f /gcc/stor-layout.c | |
parent | ceeaadbb7808485164e3079e4bf60fa07a3ad66d (diff) | |
download | gcc-fe375cf108993c9afcef778e4b2def2ddf43160e.zip gcc-fe375cf108993c9afcef778e4b2def2ddf43160e.tar.gz gcc-fe375cf108993c9afcef778e4b2def2ddf43160e.tar.bz2 |
stor-layout.c (is_pending_size, [...]): New functions.
* stor-layout.c (is_pending_size, put_pending_size): New functions.
(variable_size): Call put_pending_size.
* tree.h (is_pending_size, put_pending_size): Add prototypes.
* fold-const.c (extract_muldiv): If SAVE_EXPR is on the pending
sizes list, put newly created SAVE_EXPR there as well.
* gcc.c-torture/execute/20010209-1.c: New test.
* config/ia64/ia64.c (last_group): Only 2 entries are needed.
(errata_find_address_regs): load_group has only 2 entries.
(errata_emit_nops): Likewise. shladd is not problematic.
Clear last_group if nop was emitted.
(fixup_errata): load_group has only 2 entries.
Optimize.
From-SVN: r39663
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 7bb5b4a..065d4f6 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -94,6 +94,30 @@ get_pending_sizes () return chain; } +/* Return non-zero if EXPR is present on the pending sizes list. */ + +int +is_pending_size (expr) + tree expr; +{ + tree t; + + for (t = pending_sizes; t; t = TREE_CHAIN (t)) + if (TREE_VALUE (t) == expr) + return 1; + return 0; +} + +/* Add EXPR to the pending sizes list. */ + +void +put_pending_size (expr) + tree expr; +{ + 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 empty. */ @@ -153,8 +177,8 @@ variable_size (size) /* The front-end doesn't want us to keep a list of the expressions that determine sizes for variable size objects. */ ; - else if (TREE_CODE (size) == SAVE_EXPR) - pending_sizes = tree_cons (NULL_TREE, size, pending_sizes); + else + put_pending_size (size); return size; } |