https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119917
--- Comment #4 from Jin Haobo ---
The latest clang (trunk version) has applied this optimization, including
8/16/32/64-bit situation.
Link: https://godbolt.org/z/aTbqGTPex
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119917
--- Comment #3 from Jin Haobo ---
Thank you for your confirmation. I understand that the char/short cases are
treated differently due to integer promotion.
While I acknowledge that 8/16-bit unsigned integers undergo integer promotion
which chang
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119917
--- Comment #1 from Jin Haobo ---
Created attachment 61192
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61192&action=edit
test.cpp source code
test.cpp source code
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119917
Bug ID: 119917
Summary: [Optimization Opportunity] Inefficient code generation
for multiplication overflow detection with explicit
zero checks
Product: gcc
Versi