On Tue, Dec 16, 2025 at 01:19:49PM -0500, Andrew MacLeod wrote:
> I opened a PR https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123160  with a
> simple testcase which doesn't depend on any of my points to code and
> produces incorrect results.
> 
> In it,
> 
>   r_4 = &a.a[4];
>   _1 = r_4 + 2;
>   _2 = memset (_1, 98, 2);
> 
> Is transformed very early (in ccp1) to
> 
>   _2 = memset (&MEM <char> [(void *)&a + 6B], 98, 2);
> 
> This does happen after early_objsz, for what that's worth.

If it happens after early_objsz, then it shouldn't be a problem.
The early_objsz pass is supposed to capture the objsz 1/3 details
and replace the calls with a max or min of the stuff computed
at that point and the __builtin_object_size / __builtin_dynamic_object_size
calls.

        Jakub

Reply via email to