https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89809
JunMa <JunMa at linux dot alibaba.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |JunMa at linux dot alibaba.com --- Comment #2 from JunMa <JunMa at linux dot alibaba.com> --- g++ pr89809.cpp -O3 -fdump-tree-store-merging: foo (const unsigned char * p) { unsigned char _1; signed short _2; unsigned char _3; int _4; int _5; signed short _6; signed short _7; uint16_t _10; <bb 2> [local count: 1073741824]: _1 = *p_9(D); _2 = (signed short) _1; _3 = MEM[(const unsigned char *)p_9(D) + 1B]; _4 = (int) _3; _5 = _4 << 8; _6 = (signed short) _5; _7 = _2 | _6; _10 = (uint16_t) _7; return _10; } looks like gcc generates too many type conversions, this prevents the optimization.