[Bug middle-end/113514] Wrong __builtin_dynamic_object_size when using a set local variable

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jan 20 00:18:00 GMT 2024


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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
In the case of the constant proping into `&f.bar[argc][0]`, it is not know if
you are doing an offset of the original struct or an offset into the array.
GCC's internal IR changes into the former as it is more canonical form while
with the constant already there is known at front-end time.

With respect of a non-constant one, GCC's IR keeps the array form address
around which allows the answer of still 40.

I can't explain clang/LLVM's behavior for `,3` though.


More information about the Gcc-bugs mailing list