This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/79345] [6/7 Regression] passing yet-uninitialized member as argument to base class constructor should warn (-Wunitialized)


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

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Thu Mar  2 13:42:05 2017
New Revision: 245840

URL: https://gcc.gnu.org/viewcvs?rev=245840&root=gcc&view=rev
Log:
2017-03-02  Richard Biener  <rguenther@suse.de>

        PR tree-optimization/79345
        PR c++/42000
        * tree-ssa-alias.c (walk_aliased_vdefs_1): Take a limit
        param and abort the walk, returning -1 if it is hit.
        (walk_aliased_vdefs): Take a limit param and pass it on.
        * tree-ssa-alias.h (walk_aliased_vdefs): Add a limit param,
        defaulting to 0 and return a signed int.
        * tree-ssa-uninit.c (struct check_defs_data): New struct.
        (check_defs): New helper.
        (warn_uninitialized_vars): Use walk_aliased_vdefs to warn
        about uninitialized memory.

        * fixed-value.c (fixed_from_string): Use ulow/uhigh to avoid
        bogus uninitialized warning.
        (fixed_convert_from_real): Likewise.

        * g++.dg/warn/Wuninitialized-7.C: New testcase.
        * c-c++-common/ubsan/bounds-2.c: Add -Wno-uninitialized.
        * gcc.dg/uninit-pr19430-2.c: Add expected warning.

Added:
    trunk/gcc/testsuite/g++.dg/warn/Wuninitialized-7.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fixed-value.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/c-c++-common/ubsan/bounds-2.c
    trunk/gcc/testsuite/gcc.dg/uninit-pr19430-2.c
    trunk/gcc/tree-ssa-alias.c
    trunk/gcc/tree-ssa-alias.h
    trunk/gcc/tree-ssa-uninit.c

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]