fix for gcc.c-torture/noncompile/920824-1.c segv
Joern Rennecke
amylaar@cygnus.co.uk
Fri Nov 26 11:50:00 GMT 1999
Fri Nov 26 19:47:39 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* dwarfout.c (field_byte_offset): Size can be zero if there was
an error.
Index: dwarfout.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/dwarfout.c,v
retrieving revision 1.101
diff -p -r1.101 dwarfout.c
*** dwarfout.c 1999/11/05 09:33:43 1.101
--- dwarfout.c 1999/11/26 19:48:55
*************** field_byte_offset (decl)
*** 2037,2042 ****
--- 2037,2052 ----
bitpos_tree = DECL_FIELD_BITPOS (decl);
field_size_tree = DECL_SIZE (decl);
+ /* If there was an error, the size could be zero.
+ This happens for gcc.c-torture/noncompile/920824-1.c on SH (and mips?). */
+ 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. */
More information about the Gcc-patches
mailing list