summaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-14 07:57:49 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-14 07:57:49 +0000
commitfe1302cffc9f963afbea472bb4ac9fce52d759a0 (patch)
tree1998ac8deccf251adebd1cb63da29b3285bdd37f /gcc/stor-layout.c
parentd4fd22f2e3fbdf417a6e7e8230bfa34a04d75b31 (diff)
downloadgcc-fe1302cffc9f963afbea472bb4ac9fce52d759a0.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39663 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 7bb5b4a2636..065d4f61201 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;
}