Re: [PATCH] bswap: Fix UB in find_bswap_or_nop_finalize [PR103435]

2021-11-27 Thread Richard Biener via Gcc-patches
On November 27, 2021 9:47:55 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >On gcc.c-torture/execute/pr103376.c in the following code we trigger UB >in the compiler. n->range is 8 because it is 64-bit load and rsize is 0 >because it is a bswap sequence with load and known to be 0: > /* Find real

[PATCH] bswap: Fix UB in find_bswap_or_nop_finalize [PR103435]

2021-11-27 Thread Jakub Jelinek via Gcc-patches
Hi! On gcc.c-torture/execute/pr103376.c in the following code we trigger UB in the compiler. n->range is 8 because it is 64-bit load and rsize is 0 because it is a bswap sequence with load and known to be 0: /* Find real size of result (highest non-zero byte). */ if (n->base_addr) for