This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] errno can't alias locals (PR 92412)
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 12 Nov 2019 09:04:58 +0100
- Subject: Re: [PATCH] errno can't alias locals (PR 92412)
- References: <5311b2b4-3822-1996-5f80-e4afa2ea51f7@gmail.com>
On Mon, Nov 11, 2019 at 11:38 PM Martin Sebor <msebor@gmail.com> wrote:
>
> The conditional in default_ref_may_alias_errno has the function
> return true even for local variables, implying that locals must
> be assumed not to have been changed across calls to errno-setting
> functions like malloc. This leads to both worse code and also
> false negatives in the strlen pass' detection of buffer overflow
> across such calls.
>
> The attached patch constrains the conditional to only consider
> external declarations.
>
> Tested on x86_64-linux.
OK.
This means a tentative definition for 'errno' is non-conforming?
(besides not working well in practice, of course)
Thanks,
Richard.
>
> Martin