https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85091

--- Comment #16 from Vadim Zeitlin <vz-gcc at zeitlins dot org> ---
(In reply to Alexander Monakov from comment #13)
> It corresponds to
> 
>     if(!(!std::signbit(bourn_cast<To>( From(0))))) {
> lmi_test::record_error(); };
>     if(!(std::signbit(bourn_cast<To>(-From(0))))) {
> lmi_test::record_error(); };
> 
> in template instantiation test_floating_conversions<double, float>.
> Essentially, with -Wnonnull the second condition seems to be folded to truth
> value.

This is reassuring because this pinpoints the problem I had had originally: the
unit test failed because the signbit() check didn't pass. I thought this wasn't
relevant as the difference in the generated code (i.e. "lock addl $0x1,0x4c"
instead of "xor %eax, %eax") didn't seem to be related to it, but apparently it
still is.

And I can also confirm that -Wnonnull is sufficient for the output to change
with the final test case. It wasn't for the original program, but apparently
delta simplified things enough for -Woverloaded-virtual to become unnecessary
at some point (would it be important to find when? If so, I could try doing
this...).

Reply via email to