http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48985
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-31 12:25:59 UTC --- Author: rguenth Date: Tue May 31 12:25:52 2011 New Revision: 174476 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174476 Log: 2011-05-31 Richard Guenther <rguent...@suse.de> Backport from mainline 2011-05-19 Richard Guenther <rguent...@suse.de> PR middle-end/48985 * tree-object-size.c (addr_object_size): If the pointed-to variable is a decl use DECL_SIZE_UNIT instead of TYPE_SIZE_UNIT. * gcc.dg/builtin-object-size-11.c: New testcase. Added: branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/builtin-object-size-11.c Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/testsuite/ChangeLog branches/gcc-4_6-branch/gcc/tree-object-size.c