On 5/13/21 1:03 PM, Jeff Law wrote:

On 5/11/2021 1:49 PM, Martin Sebor via Gcc-patches wrote:
The attached change teaches the uninitialized pass about
__builtin_stack_restore and __builtin___asan_mark to avoid two
classes of -Wuninitialized false negatives.

Richard, you already approved the __builtin_stack_restore change
in the bug but I figured I'd submit a patch with both changes for
approval since they affect the same piece of code.

Martin

gcc-93100.diff

Avoid -Wuninitialized false negatives with sanitization and VLAs.

Resolves:
PR tree-optimization/93100 - gcc -fsanitize=address inhibits -Wuninitialized
PR middle-end/98583 - missing -Wuninitialized reading from a second VLA in its 
own block

gcc/ChangeLog:

        PR tree-optimization/93100
        PR middle-end/98583
        * tree-ssa-uninit.c (check_defs):

gcc/testsuite/ChangeLog:

        PR tree-optimization/93100
        PR middle-end/98583
        * g++.dg/warn/uninit-pr93100.C: New test.
        * gcc.dg/uninit-pr93100.c: New test.
        * gcc.dg/uninit-pr98583.c: New test.

OK.  I wonder if it would make sense to describe this property when we construct the builtin and check that property rather than each builtin we find over time.  Your call on whether or not to explore that.

I like the idea.  Adding atrribute access to the built-ins would
be one way.  Attribute fn spec might be able to express the same
thing although there I'm not sure if it would apply to
the sanitizer functions.  Either way it seems worth looking into.

Thanks
Martin



Jeff


Reply via email to