[Bug c++/68281] '&&' is checked in reverse and reads an uninitialized value
jistone at redhat dot com
gcc-bugzilla@gcc.gnu.org
Wed Nov 11 00:05:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68281
--- Comment #1 from Josh Stone <jistone at redhat dot com> ---
I suspect this may actually be acceptable, NOTABUG, because I can't think of
any uninitialized data that would make the effective behavior different than if
it had been checked in the proper order. Both conditions still have to be met,
and there's no bad pointer deref or anything.
I guess the optimizer just took a guess which side is most likely to be the
deciding factor. But I'm not sure if valgrind can possibly recognize that this
uninit condition is actually ok.
(I can just give these values a default init as a workaround, of course.)
More information about the Gcc-bugs
mailing list