aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-10-08 04:58:24 +0000
committerRichard Stallman <rms@gnu.org>1993-10-08 04:58:24 +0000
commit2dca20cd247a5502fc1fe2f0d1e63a29c3b92ae3 (patch)
tree90a890c8ae6ce46d546faf2b67d8776eba3a8104
parent20bf3fac14ef2e556787dd07199d45dbd813e31d (diff)
downloadgcc-2dca20cd247a5502fc1fe2f0d1e63a29c3b92ae3.zip
gcc-2dca20cd247a5502fc1fe2f0d1e63a29c3b92ae3.tar.gz
gcc-2dca20cd247a5502fc1fe2f0d1e63a29c3b92ae3.tar.bz2
(expand_expr, case VAR_DECL): If decl wasn't laid out,
lay it out now, and fix the rtl's mode. From-SVN: r5671
-rw-r--r--gcc/expr.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 5711d0c..0d01325 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3681,8 +3681,19 @@ expand_expr (exp, target, tmode, modifier)
return CONST0_RTX (mode);
}
- case FUNCTION_DECL:
case VAR_DECL:
+ /* If a static var's type was incomplete when the decl was written,
+ but the type is complete now, lay out the decl now. */
+ if (DECL_SIZE (exp) == 0 && TYPE_SIZE (TREE_TYPE (exp)) != 0
+ && (TREE_STATIC (exp) || DECL_EXTERNAL (exp)))
+ {
+ push_obstacks_nochange ();
+ end_temporary_allocation ();
+ layout_decl (exp, 0);
+ PUT_MODE (DECL_RTL (exp), DECL_MODE (exp));
+ pop_obstacks ();
+ }
+ case FUNCTION_DECL:
case RESULT_DECL:
if (DECL_RTL (exp) == 0)
abort ();