From 1373dc94fbacca7767e4794f7d1bf7ca36178f6b Mon Sep 17 00:00:00 2001 From: amylaar Date: Mon, 29 Nov 1999 18:11:35 +0000 Subject: Fix for gcc.c-torture/noncompile/920824-1.c on SH (and mips?) * dwarfout.c (field_byte_offset): Size can be zero if there was an error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30708 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/dwarfout.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/dwarfout.c') diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index d8ddfb09939..1df09c60ee1 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -2024,6 +2024,15 @@ field_byte_offset (decl) bitpos_tree = DECL_FIELD_BITPOS (decl); field_size_tree = DECL_SIZE (decl); + /* If there was an error, the size could be zero. */ + if (! field_size_tree) + { + if (errorcount) + return 0; + abort (); + } + + /* We cannot yet cope with fields whose positions or sizes are variable, so for now, when we see such things, we simply return 0. Someday, we may be able to handle such cases, but it will be damn difficult. */ -- cgit v1.2.1