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

--- Comment #3 from JunMa <JunMa at linux dot alibaba.com> ---
the stmt generated by fe has some issue, in 004t.original dump file:
return <retval> = (uint16_t) ((signed short) *p | (signed short) ((int) *(p +
1) << 8));

However, the return stmt should be:

return <retval> = (uint16_t) (((int)(uint16_t) *p) | ((int)(uint16_t) *(p + 1)
<< 8));

then gcc will optimize it.

Reply via email to