aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-01-18 15:58:48 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1997-01-18 15:58:48 -0500
commit02a27e82af8dcf59669678e6a143c45e81a08558 (patch)
tree37e6ceb752205a901f325fb11129c369cf8a66e4 /gcc
parenta9d07d6e65f690431a892903c89404a9ed291000 (diff)
downloadgcc-02a27e82af8dcf59669678e6a143c45e81a08558.zip
gcc-02a27e82af8dcf59669678e6a143c45e81a08558.tar.gz
gcc-02a27e82af8dcf59669678e6a143c45e81a08558.tar.bz2
(get_unwidened): Don't crash if FIELD_DECL not layed out.
From-SVN: r13508
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index f8b1a6e..d9b5abe 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4181,7 +4181,9 @@ get_unwidened (op, for_type)
if (TREE_CODE (op) == COMPONENT_REF
/* Since type_for_size always gives an integer type. */
- && TREE_CODE (type) != REAL_TYPE)
+ && TREE_CODE (type) != REAL_TYPE
+ /* Don't crash if field not layed out yet. */
+ && DECL_SIZE (TREE_OPERAND (op, 1)) != 0)
{
unsigned innerprec = TREE_INT_CST_LOW (DECL_SIZE (TREE_OPERAND (op, 1)));
type = type_for_size (innerprec, TREE_UNSIGNED (TREE_OPERAND (op, 1)));