This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug c/68971] -Woverflow false alarm in code unreachable after __builtin_mul_overflow


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

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Yes, the example in footnote is valid because the left operand of the OR
expression is a constant expression with a non-zero value and so the right
operand is not evaluated (even at translation time).

__builtin_mul_overflow, OTOH, is not a constant expression, and so the
multiplication expression may be evaluated (and is allowed to be evaluated at
compile time) and the warning is, IMO, justified.

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