Re: [PATCH v2] gimple-fold: Smarter optimization of _chk variants

2021-11-10 Thread Siddhesh Poyarekar
On 11/10/21 16:15, Siddhesh Poyarekar wrote: Instead of comparing LEN and SIZE only if they are constants, use their ranges to decide if LEN will always be lower than or same as SIZE. This change ends up putting the stringop-overflow warning line number against the strcpy implementation, so adju

[PATCH v2] gimple-fold: Smarter optimization of _chk variants

2021-11-10 Thread Siddhesh Poyarekar
Instead of comparing LEN and SIZE only if they are constants, use their ranges to decide if LEN will always be lower than or same as SIZE. This change ends up putting the stringop-overflow warning line number against the strcpy implementation, so adjust the warning check to be line number agnostic