[Bug tree-optimization/105078] Maybe wrong *** buffer overflow detected ***: terminated with -D_FORTIFY_SOURCE
siddhesh at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 28 15:42:23 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078
--- Comment #5 from Siddhesh Poyarekar <siddhesh at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #4)
> Note the libQt6 version of the function looking approximately like this:
>
This doesn't warn anymore (and doesn't crash either) because objsz cannot get
past the bit_and_expr:
gimple_assign <plus_expr, _11, data.0_10, 7, NULL>
gimple_assign <bit_and_expr, _12, _11, 18446744073709551612, NULL>
gimple_assign <nop_expr, start_13, _12, NULL, NULL>
gimple_call <__builtin_object_size, _2, start_13, 1>
However, ISTM from the remaining IR that thanks to the casts, it will see the
right size if it got past the bit_and_expr.
Jakub, should we recognize bit_and_expr in objsz for gcc13?
More information about the Gcc-bugs
mailing list