Re: [PR100843] store by mult pieces: punt on max_len < min_len

2021-12-14 Thread Jeff Law via Gcc-patches
On 12/10/2021 10:18 PM, Alexandre Oliva wrote: On Dec 10, 2021, Jeff Law wrote: The patch is clearly safe.  My question is should we have caught this earlier in the call chain? Callers will call try_store_by_multiple_pieces if set_storage_via_setmem fails. setmem doesn't necessarily need

Re: [PR100843] store by mult pieces: punt on max_len < min_len

2021-12-10 Thread Alexandre Oliva via Gcc-patches
On Dec 10, 2021, Jeff Law wrote: > The patch is clearly safe.  My question is should we have caught this > earlier in the call chain? Callers will call try_store_by_multiple_pieces if set_storage_via_setmem fails. setmem doesn't necessarily need min and max len to do its job, so if we were to

Re: [PR100843] store by mult pieces: punt on max_len < min_len

2021-12-10 Thread Jeff Law via Gcc-patches
On 12/9/2021 3:16 PM, Alexandre Oliva via Gcc-patches wrote: The testcase confuses the code that detects min and max len for the memset, so max_len ends up less than min_len. That shouldn't be possible, but the testcase requires us to handle this case. The store-by-mult-pieces algorithm

[PR100843] store by mult pieces: punt on max_len < min_len

2021-12-09 Thread Alexandre Oliva via Gcc-patches
The testcase confuses the code that detects min and max len for the memset, so max_len ends up less than min_len. That shouldn't be possible, but the testcase requires us to handle this case. The store-by-mult-pieces algorithm actually relies on min and max lengths, so if we find them to be