From owner-svn-src-all@FreeBSD.ORG Fri Jan 4 03:54:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 120CD227; Fri, 4 Jan 2013 03:54:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04ABF7DD; Fri, 4 Jan 2013 03:54:23 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r043sMEP046989; Fri, 4 Jan 2013 03:54:22 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r043sM5O046988; Fri, 4 Jan 2013 03:54:22 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201301040354.r043sM5O046988@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 4 Jan 2013 03:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245024 - stable/8/contrib/gcc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 03:54:23 -0000 Author: pfg Date: Fri Jan 4 03:54:22 2013 New Revision: 245024 URL: http://svnweb.freebsd.org/changeset/base/245024 Log: MFC 244776, 244792: 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. Modified: stable/8/contrib/gcc/dwarf2out.c Modified: stable/8/contrib/gcc/dwarf2out.c ============================================================================== --- stable/8/contrib/gcc/dwarf2out.c Fri Jan 4 03:54:05 2013 (r245023) +++ stable/8/contrib/gcc/dwarf2out.c Fri Jan 4 03:54:22 2013 (r245024) @@ -10812,9 +10812,9 @@ add_byte_size_attribute (dw_die_ref die, /* 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 sizes 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