This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug libstdc++/38107] gcc source contains a struct with no data members (actually 1 byte in size) and compiler does not initialize it, resulting in IBM Rational Purify reporting an Uninitialized Memory Read.
- From: Andrew Thomas Pinski <pinskia at gmail dot com>
- To: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- Cc: "gcc-bugs at gcc dot gnu dot org" <gcc-bugs at gcc dot gnu dot org>
- Date: Fri, 14 Nov 2008 10:01:13 -0800
- Subject: Re: [Bug libstdc++/38107] gcc source contains a struct with no data members (actually 1 byte in size) and compiler does not initialize it, resulting in IBM Rational Purify reporting an Uninitialized Memory Read.
- References: <bug-38107-16946@http.gcc.gnu.org/bugzilla/> <20081114170559.20974.qmail@sourceware.org>
Sent from my iPhone
On Nov 14, 2008, at 9:05 AM, "efinger at us dot ibm dot com" <gcc-bugzilla@gcc.gnu.org
> wrote:
------- Comment #4 from efinger at us dot ibm dot com 2008-11-14
17:05 -------
(In reply to comment #2)
There are going to be other holes in structs in general due to
alignment
requirements and I don't think the compiler or libstdc++ should
change to this
because it will slow down the generated code and not really makes a
difference
in the outcome of the code.
Purify already handles pad bytes added for alignment correctly.
This is a very
specific case, where the pad byte is added to prevent the struct
from having
size zero, not for alignment. The added code to clear 1 byte, at
object
constuction time, would not make any significant performance
difference.
But it can cause code bloat which can cause performance issues because
of icache sizes and such.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38107