Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/gcc4/gcc Apply GCC/35998 from FreeBSD http://svnweb...



details:   https://anonhg.NetBSD.org/src/rev/f4de0b92ac2a
branches:  trunk
changeset: 784079:f4de0b92ac2a
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 17 20:01:37 2013 +0000

description:
Apply GCC/35998 from FreeBSD http://svnweb.freebsd.org/changeset/base/245024

gcc: avoid generating negative values to DW_AT_byte_size.

There is a bug in gcc (GCC/35998) where dwarf reports
sizes of unsigned -1 (0xffffffff).

On NetBSD this generated a faulty CTF entry which then
caused a segfault in ctfmerge. The issue was worked
around in NetBSD's Dtrace but since the issue originated
in gcc, it seems reasonable to fix it here.

Thanks to Christoph Mallon for pointing out a correct fix.

diffstat:

 gnu/dist/gcc4/gcc/dwarf2out.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (15 lines):

diff -r a7ab4d1cc7b8 -r f4de0b92ac2a gnu/dist/gcc4/gcc/dwarf2out.c
--- a/gnu/dist/gcc4/gcc/dwarf2out.c     Thu Jan 17 19:10:56 2013 +0000
+++ b/gnu/dist/gcc4/gcc/dwarf2out.c     Thu Jan 17 20:01:37 2013 +0000
@@ -10683,8 +10683,9 @@
   /* Note that `size' might be -1 when we get to this point.  If it is, that
      indicates that the byte size of the entity in question is variable.  We
      have no good way of expressing this fact in Dwarf at the present time,
-     so just let the -1 pass on through.  */
-  add_AT_unsigned (die, DW_AT_byte_size, size);
+     have no good way of expressing this fact in Dwarf at the present time.
+     GCC/35998: Avoid passing negative size values to Dtrace and gdb. */
+  add_AT_unsigned (die, DW_AT_byte_size, (size != (unsigned)-1 ? size : 0));
 }
 
 /* For a FIELD_DECL node which represents a bit-field, output an attribute



Home | Main Index | Thread Index | Old Index