Fix for gcc.c-torture/noncompile/920824-1.c on SH (and mips?)
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Mon, 29 Nov 1999 18:11:35 +0000 (18:11 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Mon, 29 Nov 1999 18:11:35 +0000 (18:11 +0000)
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.

From-SVN: r30708

gcc/ChangeLog
gcc/dwarfout.c

index 07811cbb6c9974243b97e40e962627289baf727a..afd4fc99beefad9f37778dc77355e626b7da1c08 100644 (file)
@@ -1,3 +1,8 @@
+Mon Nov 29 18:09:39 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * dwarfout.c (field_byte_offset): Size can be zero if there was
+       an error.
+
 1999-11-29  Bernd Schmidt  <bernds@cygnus.co.uk>
 
        * fold-const.c (split_tree): Delete unused vars ORIG_IN and TYPE.
index d8ddfb09939c6fca71d58c6f29f1b69e68b92c52..1df09c60ee1e772c5d80b9268cd393d7720a5d2a 100644 (file)
@@ -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.  */