This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR libstdc++/19510: Uninitialized variable in some iterators

Mark Mitchell <> writes:

| I think it's a mistake to add these explicit initializations on
| platforms that do not actually require it.  Copying uninitialized data
| may be undefined in ISO C++, but on most systems it's well-defined:
| whatever bits happened to be there get copied.  All you're
| accomplishing is making the library slower.
| On some systems (IA64) you can get traps on accessing registers with
| the NaT bit set, but on most others, there is no issue.  I can see an
| argument for performing these default initializations in debugging
| mode, or with a flag set by the user, by the default behavior ought to
| be to go as fast as possible.

Most uses of iterators are in the form of definition+initialization.
So no issue there.

In the typical case where a singular iterator is created, it is
inlined and if the compiler cannot figure out that those inlined
initialization can be efficiently turned into something else, then
it is a compiler bug.

-- Gaby

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]