[Bug tree-optimization/81811] missing -Wreturn-local-addr returning strcpy result

egallager at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 12 04:26:00 GMT 2018


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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization

--- Comment #4 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #3)
> (In reply to Richard Biener from comment #2)
> > Wonder whether the memcpy case is because we fold the memcpy away as both
> > memcpy and strcpy are marked RET1 (returns arg1).
> 
> The memcpy is eliminated in DSE and turned into a plain 'return a' statement
> that  the find_explicit_erroneous_behavior() in tree-ssa-isolate-paths.c
> that implements the warning knows how to handle.
> 
> DSE doesn't handle strcpy or strncpy so the calls are not eliminated and
> because find_explicit_erroneous_behavior() doesn't handle calls, the 'return
> strcpy(a, s)' statement isn't detected.
> 
> This suggests an opportunity to improve not just the warning but also DSE.

so, sounds like a missed-optimization too, then


More information about the Gcc-bugs mailing list