https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108621
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Close as FIXED - and thanks to Michael for the report!
On GCC 13 (mainline), only:
* For intent(out), the pointless code is no longer produced
and, thus, also the warning is gone.
→ No backport to GCC 12 planned as this was only a bogus warning
that ignored the "nullify()" - contrary to the generated code.
* PR middle-end/108906 – tracks the bogus warning with -O0 (gone with
optimization). Note: this message contains "may", i.e. the message
is correct (even if the "may" never occurs).
The issue still occurs with any intent but 'intent(out)'
* The generated code is/was fine – except possibly for the following,
but we cannot do anything about this with the current descriptors:
– For undefined pointers, which is valid* if no 'intent' is known
at the caller side (and the pointer is not read in the called proc):
Unless the pointer happens to point to NULL, the code will access unit
memory and might even overflowing integer arithmetic.
→ Should be usually still fine as long nothing is trapping or overflows
are checked for with -fsanitize=undefined. (And cannot be avoided.)
[(*) it is also valid with 'intent(out)' but since the just committed patch,
GCC 13 no longer generates affected code.]