On Mon, 1 Jun 2026, Martin Uecker wrote: > Bootstrapped and regression tested on x86_64. > > c: fix wrong code with counted_by attribute [PR123569] > > For an access to a member of pointer type with counted_by attribute, > the .ACCESS_WITH_SIZE internal function is inserted at certain places > before reading the pointer. This leads to wrong code for increment > and decrement operations. For now, do not instrument these accesses > by using default_function_array_conversion instead of > default_function_array_read_conversion and by calling mark_exp_read > directly. Code to conditionally undo the effect of mark_exp_read can > be simplified. > > PR c/123569 > > gcc/c/ChangeLog: > * c-parser.cc (mark_exp_read_cond): New function. > (c_parser_unary_expression): Use mark_exp_read_cond. > (c_parser_postfix_expression_after_primary): Likewise. > * c-typeck.cc (build_unary_op): Remove dead code and > add checking assertion. > > gcc/testuite/ChangeLog: > * gcc.dg/pr123569.c: New test.
OK. -- Joseph S. Myers [email protected]
