Hello,
first, I expect this to be controversial, so feel free to complain.
The description of -Wall says "This enables all the warnings about
constructions that some users consider questionable, and that are easy
to avoid (or modify to prevent the warning), even in conjunction with
macros."
And the description of -Wmaybe-uninitialized "For an automatic variable,
if there exists a path from the function entry to a use of the variable
that is initialized, but there exist some other paths for which the
variable is not initialized, the compiler emits a warning if it cannot
prove the uninitialized paths are not executed at run time. These
warnings are made optional because GCC is not smart enough to see all
the reasons why the code might be correct in spite of appearing to have
an error."
-Wmaybe-uninitialized generates false positives, we can tweak the compiler
to reduce them, but there will always be some, that's in the nature of
this warning.
These false positives are not easy to avoid, as required to be part of
-Wall. Avoiding them, when it is possible at all, requires not just a
syntactic tweak, like adding parentheses, but a semantic change that can
make the code worse. Initializing something that does not need it is extra
code (increases code size and running time). It also prevents better tools
from detecting true uninitialized uses, either static analyzers or runtime
checkers (sanitizer, valgrind).
This message concentrates on the negatives, but that doesn't mean I
consider -Wmaybe-uninitialized as useless. It can find true uninitialized
uses. And even some false positives can point at places where we can help
the compiler generate better code (say with a default
__builtin_unreachable case in a switch). I did in the past contribute
patches to make it warn more often, and I might do so again in the future.
My opinion is that -Wmaybe-uninitialized would serve its purpose better as
part of -Wextra. People tend to use -Wall with -Werror (either explicitly
or implicitly by modifying the code until all warnings are gone). What I
see currently in projects where I participate is that
-Wmaybe-uninitialized is making things worse. People don't investigate
deeply the cause of the warning, they just go for whatever "quick-fix"
makes the compiler shut up. Quite often, this involves extra code that is
less readable and performs worse, while it didn't even "fix" what caused
the warning, it just randomly ended up with code where the compiler
doesn't warn (possibly because the function got bigger, which changed
inlining decisions...).
If the warning is not enabled by default so much but only when people are
ready to investigate any warning thoroughly, the quickfix mentality is
less likely to be present. People using -Wmaybe-uninitialized need to be
willing to ignore false positives, or disable them with pragmas.
Note that similar arguments may apply to some other warnings that somehow
made their way into -Wall when they shouldn't have, but for now I am only
proposing to move -Wmaybe-uninitialized. Some people tend to consider that
if a warning is not part of -Wall, it might as well not exist. Obviously I
disagree with that.
-------
Now the actual patch. Surprisingly, the middle-end puts both
Wuninitialized and Wmaybe-uninitialized in Wextra, it is the C-family of
front-ends that puts them in Wall. It also makes Wuninitialized enable
Wmaybe-uninitialized, which is backwards (it made sense historically),
Wuninitialized has much fewer false positives, and if we are willing to be
warned about possibly uninitialized uses, we certainly also want warnings
about uninitialized uses that are certain. So I am switching the enabling
relation between those 2, and enabling only Wuninitialized at Wall.
If the patch gets in, this will of course require a mention in the release
notes.
I changed a set of tests based on a mix of grep and seeing what failed
make check. The exact list may not be optimal.
gcc/ChangeLog:
2019-02-01 Marc Glisse <marc.gli...@inria.fr>
* common.opt (Wuninitialized): Enable with Wmaybe-uninitialized.
(Wmaybe-uninitialized): Enable with Wextra.
* doc/invoke.texi: Update implications between Wuninitialized,
Wmaybe-uninitialized, Wall and Wextra.
gcc/c-family/ChangeLog:
2019-02-01 Marc Glisse <marc.gli...@inria.fr>
* c.opt (Wmaybe-uninitialized): Enable with Wextra.
gcc/testsuite/ChangeLog:
2019-02-01 Marc Glisse <marc.gli...@inria.fr>
* c-c++-common/pr69543-1.c: Use -Wmaybe-uninitialized.
* c-c++-common/pr69543-2.c: Likewise.
* c-c++-common/pr69543-3.c: Likewise.
* c-c++-common/pr69543-4.c: Likewise.
* c-c++-common/uninit-17.c: Likewise.
* g++.dg/pr48484.C: Likewise.
* g++.dg/uninit-pred-1_b.C: Likewise.
* g++.dg/uninit-pred-2_b.C: Likewise.
* g++.dg/uninit-pred-3_b.C: Likewise.
* g++.dg/warn/Wuninitialized-5.C: Likewise.
* g++.dg/warn/Wuninitialized-6.C: Likewise.
* g++.dg/warn/Wuninitialized-9.C: Likewise.
* gcc.dg/gomp/pr72781.c: Likewise.
* gcc.dg/pr18501.c: Likewise.
* gcc.dg/pr39666-2.c: Likewise.
* gcc.dg/pr45083.c: Likewise.
* gcc.dg/pr57149.c: Likewise.
* gcc.dg/pr59924.c: Likewise.
* gcc.dg/pr69543.c: Likewise.
* gcc.dg/uninit-11-O0.c: Likewise.
* gcc.dg/uninit-11.c: Likewise.
* gcc.dg/uninit-16.c: Likewise.
* gcc.dg/uninit-17.c: Likewise.
* gcc.dg/uninit-18.c: Likewise.
* gcc.dg/uninit-19.c: Likewise.
* gcc.dg/uninit-6-O0.c: Likewise.
* gcc.dg/uninit-pr19430-2.c: Likewise.
* gcc.dg/uninit-pr19430-O0.c: Likewise.
* gcc.dg/uninit-pr19430.c: Likewise.
* gcc.dg/uninit-pr20644-O0.c: Likewise.
* gcc.dg/uninit-pred-2_a.c: Likewise.
* gcc.dg/uninit-pred-2_b.c: Likewise.
* gcc.dg/uninit-pred-2_c.c: Likewise.
* gcc.dg/uninit-pred-3_a.c: Likewise.
* gcc.dg/uninit-pred-3_b.c: Likewise.
* gcc.dg/uninit-pred-3_c.c: Likewise.
* gcc.dg/uninit-pred-3_d.c: Likewise.
* gcc.dg/uninit-pred-3_e.c: Likewise.
* gcc.dg/uninit-pred-4_a.c: Likewise.
* gcc.dg/uninit-pred-4_b.c: Likewise.
* gcc.dg/uninit-pred-5_a.c: Likewise.
* gcc.dg/uninit-pred-5_b.c: Likewise.
* gcc.dg/uninit-pred-6_a.c: Likewise.
* gcc.dg/uninit-pred-6_b.c: Likewise.
* gcc.dg/uninit-pred-6_c.c: Likewise.
* gcc.dg/uninit-pred-6_d.c: Likewise.
* gcc.dg/uninit-pred-6_e.c: Likewise.
* gcc.dg/uninit-pred-7_a.c: Likewise.
* gcc.dg/uninit-pred-7_b.c: Likewise.
* gcc.dg/uninit-pred-7_c.c: Likewise.
* gcc.dg/uninit-pred-7_d.c: Likewise.
* gcc.dg/uninit-pred-8_a.c: Likewise.
* gcc.dg/uninit-pred-8_b.c: Likewise.
* gcc.dg/uninit-pred-8_c.c: Likewise.
* gcc.dg/uninit-pred-8_d.c: Likewise.
* gcc.dg/uninit-pred-9_a.c: Likewise.
* gcc.dg/uninit-pred-9_b.c: Likewise.
* gcc.dg/uninit-suppress_2.c: Likewise.
* gfortran.dg/pr25923.f90: Likewise.
* gfortran.dg/pr39666-2.f90: Likewise.
--
Marc Glisse
Index: gcc/c-family/c.opt
===================================================================
--- gcc/c-family/c.opt (revision 268425)
+++ gcc/c-family/c.opt (working copy)
@@ -1136,21 +1136,21 @@ Warn about @selector()s without previous
Wundef
C ObjC C++ ObjC++ CPP(warn_undef) CppReason(CPP_W_UNDEF) Var(cpp_warn_undef) Init(0) Warning
Warn if an undefined macro is used in an #if directive.
Wuninitialized
C ObjC C++ ObjC++ LTO LangEnabledBy(C ObjC C++ ObjC++ LTO,Wall)
;
Wmaybe-uninitialized
-C ObjC C++ ObjC++ LTO LangEnabledBy(C ObjC C++ ObjC++ LTO,Wall)
+C ObjC C++ ObjC++ LTO LangEnabledBy(C ObjC C++ ObjC++ LTO,Wextra)
;
Wunknown-pragmas
C ObjC C++ ObjC++ Warning Var(warn_unknown_pragmas) LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
Warn about unrecognized pragmas.
Wunsuffixed-float-constants
C ObjC Var(warn_unsuffixed_float_constants) Warning
Warn about unsuffixed float constants.
Index: gcc/common.opt
===================================================================
--- gcc/common.opt (revision 268425)
+++ gcc/common.opt (working copy)
@@ -769,25 +769,25 @@ Do not suppress warnings from system hea
Wtrampolines
Common Var(warn_trampolines) Warning
Warn whenever a trampoline is generated.
Wtype-limits
Common Var(warn_type_limits) Warning EnabledBy(Wextra)
Warn if a comparison is always true or always false due to the limited range of the data type.
Wuninitialized
-Common Var(warn_uninitialized) Warning EnabledBy(Wextra)
+Common Var(warn_uninitialized) Warning EnabledBy(Wmaybe-uninitialized)
Warn about uninitialized automatic variables.
Wmaybe-uninitialized
-Common Var(warn_maybe_uninitialized) Warning EnabledBy(Wuninitialized)
+Common Var(warn_maybe_uninitialized) Warning EnabledBy(Wextra)
Warn about maybe uninitialized automatic variables.
Wunreachable-code
Common Ignore Warning
Does nothing. Preserved for backward compatibility.
Wunused
Common Var(warn_unused) Init(0) Warning
Enable all -Wunused- warnings.
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi (revision 268425)
+++ gcc/doc/invoke.texi (working copy)
@@ -4376,21 +4376,20 @@ Options} and @ref{Objective-C and Object
-Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
-Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
-Wformat @gol
-Wint-in-bool-context @gol
-Wimplicit @r{(C and Objective-C only)} @gol
-Wimplicit-int @r{(C and Objective-C only)} @gol
-Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
-Winit-self @r{(only for C++)} @gol
-Wlogical-not-parentheses @gol
-Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)} @gol
--Wmaybe-uninitialized @gol
-Wmemset-elt-size @gol
-Wmemset-transposed-args @gol
-Wmisleading-indentation @r{(only for C/C++)} @gol
-Wmissing-attributes @gol
-Wmissing-braces @r{(only for C/ObjC)} @gol
-Wmultistatement-macros @gol
-Wnarrowing @r{(only for C++)} @gol
-Wnonnull @gol
-Wnonnull-compare @gol
-Wopenmp-simd @gol
@@ -4432,28 +4431,28 @@ them must be enabled individually.
This enables some extra warning flags that are not enabled by
@option{-Wall}. (This option used to be called @option{-W}. The older
name is still supported, but the newer name is more descriptive.)
@gccoptlist{-Wclobbered @gol
-Wcast-function-type @gol
-Wdeprecated-copy @r{(C++ only)} @gol
-Wempty-body @gol
-Wignored-qualifiers @gol
-Wimplicit-fallthrough=3 @gol
+-Wmaybe-uninitialized @gol
-Wmissing-field-initializers @gol
-Wmissing-parameter-type @r{(C only)} @gol
-Wold-style-declaration @r{(C only)} @gol
-Woverride-init @gol
-Wsign-compare @r{(C only)} @gol
-Wredundant-move @r{(only for C++)} @gol
-Wtype-limits @gol
--Wuninitialized @gol
-Wshift-negative-value @r{(in C++03 and in C99 and newer)} @gol
-Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
-Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}}
The option @option{-Wextra} also prints warning messages for the
following cases:
@itemize @bullet
@@ -5527,20 +5526,22 @@ variables that are uninitialized or clob
not occur for variables or elements declared @code{volatile}. Because
these warnings depend on optimization, the exact variables or elements
for which there are warnings depends on the precise optimization
options and version of GCC used.
Note that there may be no warning about a variable that is used only
to compute a value that itself is never used, because such
computations may be deleted by data flow analysis before the warnings
are printed.
+This warning is enabled by @option{-Wmaybe-uninitialized}.
+
@item -Winvalid-memory-model
@opindex Winvalid-memory-model
@opindex Wno-invalid-memory-model
Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
and the C11 atomic generic functions with a memory consistency argument
that is either invalid for the operation or outside the range of values
of the @code{memory_order} enumeration. For example, since the
@code{__atomic_store} and @code{__atomic_store_n} built-ins are only
defined for the relaxed, release, and sequentially consistent memory
orders the following code is diagnosed:
@@ -5599,21 +5600,21 @@ changed by a call to @code{longjmp}.
The compiler sees only the calls to @code{setjmp}. It cannot know
where @code{longjmp} will be called; in fact, a signal handler could
call it at any point in the code. As a result, you may get a warning
even when there is in fact no problem because @code{longjmp} cannot
in fact be called at the place that would cause a problem.
Some spurious warnings can be avoided if you declare all the functions
you use that never return as @code{noreturn}. @xref{Function
Attributes}.
-This warning is enabled by @option{-Wall} or @option{-Wextra}.
+This warning is enabled by @option{-Wextra}.
@item -Wunknown-pragmas
@opindex Wunknown-pragmas
@opindex Wno-unknown-pragmas
@cindex warning for unknown pragmas
@cindex unknown pragmas, warning
@cindex pragmas, warning of unknown
Warn when a @code{#pragma} directive is encountered that is not understood by
GCC@. If this command-line option is used, warnings are even issued
for unknown pragmas in system header files. This is not the case if
Index: gcc/testsuite/c-c++-common/pr69543-1.c
===================================================================
--- gcc/testsuite/c-c++-common/pr69543-1.c (revision 268425)
+++ gcc/testsuite/c-c++-common/pr69543-1.c (working copy)
@@ -1,11 +1,11 @@
-/* { dg-options "-Wuninitialized" } */
+/* { dg-options "-Wmaybe-uninitialized -Wuninitialized" } */
/* Verify disabling a warning, where the _Pragma is within
a macro, but the affected code is *not* in a macro. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
Index: gcc/testsuite/c-c++-common/pr69543-2.c
===================================================================
--- gcc/testsuite/c-c++-common/pr69543-2.c (revision 268425)
+++ gcc/testsuite/c-c++-common/pr69543-2.c (working copy)
@@ -1,11 +1,11 @@
-/* { dg-options "-Wuninitialized" } */
+/* { dg-options "-Wmaybe-uninitialized -Wuninitialized" } */
/* Verify disabling a warning, where both the _Pragma and the
affected code are *not* in a macro. */
void test (char yylval)
{
char *yyvsp;
_Pragma ("GCC diagnostic push")
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
Index: gcc/testsuite/c-c++-common/pr69543-3.c
===================================================================
--- gcc/testsuite/c-c++-common/pr69543-3.c (revision 268425)
+++ gcc/testsuite/c-c++-common/pr69543-3.c (working copy)
@@ -1,11 +1,11 @@
-/* { dg-options "-Wuninitialized" } */
+/* { dg-options "-Wmaybe-uninitialized -Wuninitialized" } */
/* Verify disabling a warning, where the _Pragma is in regular code,
but the affected code is within a macro. */
/* TODO: XFAIL: both C and C++ erroneously fail to suppress the warning
The warning is reported at the macro definition location, rather than
the macro expansion location. */
#define WARNABLE_CODE *++yyvsp = yylval; /* { dg-bogus "used uninitialized" "" { xfail *-*-* } } */
Index: gcc/testsuite/c-c++-common/pr69543-4.c
===================================================================
--- gcc/testsuite/c-c++-common/pr69543-4.c (revision 268425)
+++ gcc/testsuite/c-c++-common/pr69543-4.c (working copy)
@@ -1,11 +1,11 @@
-/* { dg-options "-Wuninitialized" } */
+/* { dg-options "-Wmaybe-uninitialized -Wuninitialized" } */
/* Verify disabling a warning, where both the _Pragma and the
affected code are within (different) macros. */
/* TODO: XFAIL: both C and C++ erroneously fail to suppress the warning
The warning is reported at the macro definition location, rather than
the macro expansion location. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
Index: gcc/testsuite/c-c++-common/uninit-17.c
===================================================================
--- gcc/testsuite/c-c++-common/uninit-17.c (revision 268425)
+++ gcc/testsuite/c-c++-common/uninit-17.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -Wuninitialized -fno-ivopts" } */
+/* { dg-options "-O2 -Wmaybe-uninitialized -fno-ivopts" } */
inline int foo(int x)
{
return x;
}
static void bar(int a, int *ptr)
{
do
{
int b; /* { dg-message "declared" } */
Index: gcc/testsuite/g++.dg/pr48484.C
===================================================================
--- gcc/testsuite/g++.dg/pr48484.C (revision 268425)
+++ gcc/testsuite/g++.dg/pr48484.C (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-O -finline-functions -finline-small-functions -Wuninitialized" } */
+/* { dg-options "-O -finline-functions -finline-small-functions -Wmaybe-uninitialized" } */
/* { dg-add-options bind_pic_locally } */
struct SQObjectPtr
{
int _type;
SQObjectPtr operator = (long);
};
struct SQObjectPtrVec
{
SQObjectPtr fff (unsigned);
Index: gcc/testsuite/g++.dg/uninit-pred-1_b.C
===================================================================
--- gcc/testsuite/g++.dg/uninit-pred-1_b.C (revision 268425)
+++ gcc/testsuite/g++.dg/uninit-pred-1_b.C (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
typedef long long int64;
void incr ();
bool is_valid (int);
int get_time ();
class A
{
public:
A ();
Index: gcc/testsuite/g++.dg/uninit-pred-2_b.C
===================================================================
--- gcc/testsuite/g++.dg/uninit-pred-2_b.C (revision 268425)
+++ gcc/testsuite/g++.dg/uninit-pred-2_b.C (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
typedef long long int64;
void incr ();
bool is_valid (int);
int get_time ();
class A
{
public:
A ();
Index: gcc/testsuite/g++.dg/uninit-pred-3_b.C
===================================================================
--- gcc/testsuite/g++.dg/uninit-pred-3_b.C (revision 268425)
+++ gcc/testsuite/g++.dg/uninit-pred-3_b.C (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
/* Multiple initialization paths. */
typedef long long int64;
void incr ();
bool is_valid (int);
int get_time ();
class A
{
Index: gcc/testsuite/g++.dg/warn/Wuninitialized-5.C
===================================================================
--- gcc/testsuite/g++.dg/warn/Wuninitialized-5.C (revision 268425)
+++ gcc/testsuite/g++.dg/warn/Wuninitialized-5.C (working copy)
@@ -1,13 +1,13 @@
// PR middle-end/39666
// { dg-do compile }
-// { dg-options "-O2 -Wuninitialized" }
+// { dg-options "-O2 -Wmaybe-uninitialized" }
int
foo (int i)
{
int j;
switch (i)
{
case -__INT_MAX__ - 1 ... -1:
j = 6;
break;
Index: gcc/testsuite/g++.dg/warn/Wuninitialized-6.C
===================================================================
--- gcc/testsuite/g++.dg/warn/Wuninitialized-6.C (revision 268425)
+++ gcc/testsuite/g++.dg/warn/Wuninitialized-6.C (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -Wuninitialized -O2" } */
namespace std {
typedef __SIZE_TYPE__ size_t;
}
extern "C++" {
inline void* operator new(std::size_t, void* __p) throw() {
return __p;
}
}
namespace boost{
Index: gcc/testsuite/g++.dg/warn/Wuninitialized-9.C
===================================================================
--- gcc/testsuite/g++.dg/warn/Wuninitialized-9.C (revision 268425)
+++ gcc/testsuite/g++.dg/warn/Wuninitialized-9.C (working copy)
@@ -1,13 +1,13 @@
// PR c++/80119
// { dg-do compile { target c++11 } }
-// { dg-options "-Wuninitialized" }
+// { dg-options "-Wmaybe-uninitialized" }
#include <type_traits>
template <bool b>
void failing_function(std::integral_constant<bool, b>)
{
int i;
if (b && (i = 4)) {
++i; // { dg-bogus "may be used uninitialized" }
}
Index: gcc/testsuite/gcc.dg/gomp/pr72781.c
===================================================================
--- gcc/testsuite/gcc.dg/gomp/pr72781.c (revision 268425)
+++ gcc/testsuite/gcc.dg/gomp/pr72781.c (working copy)
@@ -1,13 +1,13 @@
/* PR middle-end/72781 */
/* { dg-do compile } */
-/* { dg-additional-options "-O2 -Wuninitialized" } */
+/* { dg-additional-options "-O2 -Wmaybe-uninitialized" } */
int u;
void
foo (int *p)
{
int i;
#pragma omp for simd lastprivate(u) schedule (static, 32) /* { dg-bogus "may be used uninitialized in this function" } */
for (i = 0; i < 1024; i++)
u = p[i];
Index: gcc/testsuite/gcc.dg/pr18501.c
===================================================================
--- gcc/testsuite/gcc.dg/pr18501.c (revision 268425)
+++ gcc/testsuite/gcc.dg/pr18501.c (working copy)
@@ -1,14 +1,14 @@
/* Expected uninitialized variable warning. */
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized" } */
+/* { dg-options "-O -Wmaybe-uninitialized" } */
unsigned bmp_iter_set ();
int something (void);
void
bitmap_print_value_set (void)
{
unsigned first; /* { dg-warning "may be used" "conditional in loop" { xfail *-*-* } } */
for (; bmp_iter_set (); )
Index: gcc/testsuite/gcc.dg/pr39666-2.c
===================================================================
--- gcc/testsuite/gcc.dg/pr39666-2.c (revision 268425)
+++ gcc/testsuite/gcc.dg/pr39666-2.c (working copy)
@@ -1,13 +1,13 @@
/* PR middle-end/39666 */
/* { dg-do compile } */
-/* { dg-options "-O2 -Wuninitialized" } */
+/* { dg-options "-O2 -Wmaybe-uninitialized" } */
int
foo (int i)
{
int j;
switch (i)
{
case -__INT_MAX__ - 1 ... -1:
j = 6;
break;
Index: gcc/testsuite/gcc.dg/pr45083.c
===================================================================
--- gcc/testsuite/gcc.dg/pr45083.c (revision 268425)
+++ gcc/testsuite/gcc.dg/pr45083.c (working copy)
@@ -1,13 +1,13 @@
/* PR tree-optimization/45083 */
/* { dg-do compile } */
-/* { dg-options "-O2 -Wuninitialized" } */
+/* { dg-options "-O2 -Wuninitialized -Wmaybe-uninitialized" } */
struct S { char *a; unsigned b; unsigned c; };
extern int foo (const char *);
extern void bar (int, int);
static void
baz (void)
{
struct S cs[1]; /* { dg-message "was declared here" } */
switch (cs->b) /* { dg-warning "cs\[^\n\r\]*\\.b\[^\n\r\]*is used uninitialized" } */
Index: gcc/testsuite/gcc.dg/pr57149.c
===================================================================
--- gcc/testsuite/gcc.dg/pr57149.c (revision 268425)
+++ gcc/testsuite/gcc.dg/pr57149.c (working copy)
@@ -1,13 +1,13 @@
/* PR tree-optimization/57149 */
/* { dg-do compile } */
-/* { dg-options "-Os -Wuninitialized" } */
+/* { dg-options "-Os -Wmaybe-uninitialized" } */
struct A { struct A *a, *b; };
struct D { struct A e; };
struct E { unsigned char f; struct { struct A e; } g; };
struct F { struct E i[32]; };
extern int fn0 (void);
extern int fn1 (struct E *, struct D *);
static inline __attribute__ ((always_inline)) int
Index: gcc/testsuite/gcc.dg/pr59924.c
===================================================================
--- gcc/testsuite/gcc.dg/pr59924.c (revision 268425)
+++ gcc/testsuite/gcc.dg/pr59924.c (working copy)
@@ -1,13 +1,13 @@
/* PR tree-optimization/59924 */
/* { dg-do compile } */
-/* { dg-options "-O1 -Wall" } */
+/* { dg-options "-O1 -Wmaybe-uninitialized" } */
struct S { struct T *a; double b; struct S *c; };
struct T { struct S *d; };
extern void bar (double);
void
foo (struct S * x, int y, int z, int w)
{
int e;
struct S *f;
Index: gcc/testsuite/gcc.dg/pr69543.c
===================================================================
--- gcc/testsuite/gcc.dg/pr69543.c (revision 268425)
+++ gcc/testsuite/gcc.dg/pr69543.c (working copy)
@@ -1,13 +1,13 @@
/* PR preprocessor/69543 */
/* { dg-do compile } */
-/* { dg-options "-O2 -Wuninitialized" } */
+/* { dg-options "-O2 -Wuninitialized -Wmaybe-uninitialized" } */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
void test (char yylval)
{
Index: gcc/testsuite/gcc.dg/uninit-11-O0.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-11-O0.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-11-O0.c (working copy)
@@ -1,13 +1,13 @@
/* Positive test for uninitialized variables. */
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized" } */
+/* { dg-options "-Wmaybe-uninitialized -Wuninitialized" } */
int sink;
void f1(int parm) /* { dg-bogus "uninitialized" "parameter" } */
{
sink = parm; /* { dg-bogus "uninitialized" "parameter" } */
}
void f2(void)
{
Index: gcc/testsuite/gcc.dg/uninit-11.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-11.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-11.c (working copy)
@@ -1,13 +1,13 @@
/* Positive test for uninitialized variables. */
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized" } */
+/* { dg-options "-O -Wmaybe-uninitialized -Wuninitialized" } */
int sink;
void f1(int parm) /* { dg-bogus "uninitialized" "parameter" } */
{
sink = parm; /* { dg-bogus "uninitialized" "parameter" } */
}
void f2(void)
{
Index: gcc/testsuite/gcc.dg/uninit-16.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-16.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-16.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -Wuninitialized" } */
+/* { dg-options "-O2 -Wmaybe-uninitialized" } */
int foo, bar;
static
void decode_reloc(int reloc, int *is_alt)
{
if (reloc >= 20)
*is_alt = 1;
else if (reloc >= 10)
*is_alt = 0;
Index: gcc/testsuite/gcc.dg/uninit-17.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-17.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-17.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized" } */
+/* { dg-options "-O -Wmaybe-uninitialized" } */
typedef _Complex float C;
C foo(int cond)
{
C f;
__imag__ f = 0;
if (cond)
{
__real__ f = 1;
return f;
Index: gcc/testsuite/gcc.dg/uninit-18.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-18.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-18.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized" } */
+/* { dg-options "-O -Wmaybe-uninitialized" } */
char *foo(int bar, char *baz)
{
char *tmp;
if (bar & 3)
tmp = baz;
switch (bar) {
case 1:
Index: gcc/testsuite/gcc.dg/uninit-19.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-19.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-19.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized" } */
+/* { dg-options "-O -Wmaybe-uninitialized" } */
/* { dg-additional-options "-finline-small-functions" { target avr-*-* } } */
int a, l, m;
float *b;
float c, d, e, g, h;
unsigned char i, k;
void
fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4,
unsigned char *c2, float *p10)
{
Index: gcc/testsuite/gcc.dg/uninit-6-O0.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-6-O0.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-6-O0.c (working copy)
@@ -1,15 +1,15 @@
/* Spurious uninitialized variable warnings.
This one inspired by java/class.c:build_utf8_ref. */
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -ftrack-macro-expansion=2" } */
+/* { dg-options "-Wmaybe-uninitialized -ftrack-macro-expansion=2" } */
#include <stddef.h>
struct tree
{
struct tree *car;
struct tree *cdr;
int type, data;
};
Index: gcc/testsuite/gcc.dg/uninit-pr19430-2.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pr19430-2.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pr19430-2.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized" } */
+/* { dg-options "-O -Wmaybe-uninitialized" } */
int *p, *q;
int foo (int b)
{
int i, j = 0;
int *x;
p = &i;
q = &j;
if (b)
Index: gcc/testsuite/gcc.dg/uninit-pr19430-O0.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pr19430-O0.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pr19430-O0.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-O0 -Wuninitialized" } */
+/* { dg-options "-O0 -Wuninitialized -Wmaybe-uninitialized" } */
extern int bar (int);
extern void baz (int *);
int
foo (int i)
{
int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } } */
if (bar (i)) {
baz (&j);
Index: gcc/testsuite/gcc.dg/uninit-pr19430.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pr19430.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pr19430.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-O -Wuninitialized" } */
+/* { dg-options "-O -Wmaybe-uninitialized -Wuninitialized" } */
extern int bar (int);
extern void baz (int *);
int
foo (int i)
{
int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } } */
if (bar (i)) {
baz (&j);
} else {
Index: gcc/testsuite/gcc.dg/uninit-pr20644-O0.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pr20644-O0.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pr20644-O0.c (working copy)
@@ -1,13 +1,13 @@
/* PR 20644 */
/* { dg-do compile } */
-/* { dg-options "-O0 -Wuninitialized" } */
+/* { dg-options "-O0 -Wmaybe-uninitialized" } */
int foo ()
{
int i = 0;
int j;
if (1 == i)
return j; /* { dg-bogus "uninitialized" "uninitialized" { xfail *-*-* } } */
return 0;
}
Index: gcc/testsuite/gcc.dg/uninit-pred-2_a.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-2_a.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-2_a.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar (void);
void blah (int);
int foo (int n, int m, int r)
{
int flag = 0;
int v;
Index: gcc/testsuite/gcc.dg/uninit-pred-2_b.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-2_b.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-2_b.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar (void);
void blah (int);
int foo (int n, int m, int r)
{
int flag = 0;
int v;
Index: gcc/testsuite/gcc.dg/uninit-pred-2_c.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-2_c.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-2_c.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2 -fno-tree-tail-merge" } */
+/* { dg-options "-Wmaybe-uninitialized -O2 -fno-tree-tail-merge" } */
int g;
void bar (void);
void blah (int);
int foo (int n, int m, int r)
{
int flag = 0;
int v;
Index: gcc/testsuite/gcc.dg/uninit-pred-3_a.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-3_a.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-3_a.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int m, int r)
{
int flag = 0;
int v;
Index: gcc/testsuite/gcc.dg/uninit-pred-3_b.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-3_b.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-3_b.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int m, int r)
{
int flag = 0;
int v;
Index: gcc/testsuite/gcc.dg/uninit-pred-3_c.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-3_c.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-3_c.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int m, int r)
{
int flag = 0;
int v;
Index: gcc/testsuite/gcc.dg/uninit-pred-3_d.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-3_d.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-3_d.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int m, int r)
{
int flag = 0;
int v;
Index: gcc/testsuite/gcc.dg/uninit-pred-3_e.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-3_e.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-3_e.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int m, int r)
{
int flag = 0;
int v;
Index: gcc/testsuite/gcc.dg/uninit-pred-4_a.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-4_a.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-4_a.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int m, int r, int t)
{
int flag = 0;
int v;
if (t)
Index: gcc/testsuite/gcc.dg/uninit-pred-4_b.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-4_b.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-4_b.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int m, int r, int t)
{
int flag = 0;
int v;
if (t)
Index: gcc/testsuite/gcc.dg/uninit-pred-5_a.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-5_a.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-5_a.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -Wno-attributes -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -Wno-attributes -O2" } */
int g;
int bar();
int blah(int);
void t(int);
static int
__attribute__((always_inline))
foo (int n, int* v, int r)
{
Index: gcc/testsuite/gcc.dg/uninit-pred-5_b.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-5_b.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-5_b.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -Wno-attributes -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -Wno-attributes -O2" } */
int g;
int bar();
int blah(int);
void t(int);
static int
__attribute__((always_inline))
foo (int n, int* v, int r)
{
Index: gcc/testsuite/gcc.dg/uninit-pred-6_a.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-6_a.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-6_a.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n && l)
Index: gcc/testsuite/gcc.dg/uninit-pred-6_b.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-6_b.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-6_b.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n)
Index: gcc/testsuite/gcc.dg/uninit-pred-6_c.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-6_c.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-6_c.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n > 10)
Index: gcc/testsuite/gcc.dg/uninit-pred-6_d.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-6_d.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-6_d.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n)
Index: gcc/testsuite/gcc.dg/uninit-pred-6_e.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-6_e.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-6_e.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n > 10)
Index: gcc/testsuite/gcc.dg/uninit-pred-7_a.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-7_a.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-7_a.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n || l)
Index: gcc/testsuite/gcc.dg/uninit-pred-7_b.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-7_b.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-7_b.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n > 10)
Index: gcc/testsuite/gcc.dg/uninit-pred-7_c.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-7_c.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-7_c.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n)
Index: gcc/testsuite/gcc.dg/uninit-pred-7_d.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-7_d.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-7_d.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-Wuninitialized -O2 -mbranch-cost=0" } */
+/* { dg-options "-Wmaybe-uninitialized -O2 -mbranch-cost=0" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n || l)
Index: gcc/testsuite/gcc.dg/uninit-pred-8_a.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-8_a.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-8_a.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
/* Pick a particular tuning to pin down BRANCH_COST. */
/* { dg-additional-options "-mtune=cortex-a15" { target arm*-*-* } } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
Index: gcc/testsuite/gcc.dg/uninit-pred-8_b.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-8_b.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-8_b.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n < 10 || m > 100 || r < 20 || l)
Index: gcc/testsuite/gcc.dg/uninit-pred-8_c.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-8_c.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-8_c.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n < 10 && m > 100 && r < 20 )
Index: gcc/testsuite/gcc.dg/uninit-pred-8_d.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-8_d.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-8_d.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-Wuninitialized -O2 -mbranch-cost=0" } */
+/* { dg-options "-Wmaybe-uninitialized -O2 -mbranch-cost=0" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if (n || m || r || l)
Index: gcc/testsuite/gcc.dg/uninit-pred-9_a.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-9_a.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-9_a.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if ( (n < 10) && (m == l) && (r < 20) )
Index: gcc/testsuite/gcc.dg/uninit-pred-9_b.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-pred-9_b.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-pred-9_b.c (working copy)
@@ -1,13 +1,13 @@
/* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
int g;
void bar();
void blah(int);
int foo (int n, int l, int m, int r)
{
int v;
if ( (n < 10) && (m != 100) && (r < 20) )
Index: gcc/testsuite/gcc.dg/uninit-suppress_2.c
===================================================================
--- gcc/testsuite/gcc.dg/uninit-suppress_2.c (revision 268425)
+++ gcc/testsuite/gcc.dg/uninit-suppress_2.c (working copy)
@@ -1,12 +1,12 @@
/* { dg-do compile } */
-/* { dg-options "-fno-tree-dominator-opts -fno-tree-ccp -fno-tree-vrp -fno-tree-fre -fno-tree-pre -fno-code-hoisting -O2 -Wuninitialized -Werror=uninitialized -Wno-error=maybe-uninitialized" } */
+/* { dg-options "-fno-tree-dominator-opts -fno-tree-ccp -fno-tree-vrp -fno-tree-fre -fno-tree-pre -fno-code-hoisting -O2 -Wuninitialized -Wmaybe-uninitialized -Werror=uninitialized -Wno-error=maybe-uninitialized" } */
void blah();
void bar (int);
int gflag;
void foo()
{
int v;
if (gflag)
v = 10;
Index: gcc/testsuite/gfortran.dg/pr25923.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr25923.f90 (revision 268425)
+++ gcc/testsuite/gfortran.dg/pr25923.f90 (working copy)
@@ -1,12 +1,12 @@
! { dg-do compile }
-! { dg-options "-O -Wuninitialized" }
+! { dg-options "-O -Wmaybe-uninitialized" }
module foo
implicit none
type bar
integer :: yr
end type
contains
Index: gcc/testsuite/gfortran.dg/pr39666-2.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr39666-2.f90 (revision 268425)
+++ gcc/testsuite/gfortran.dg/pr39666-2.f90 (working copy)
@@ -1,13 +1,13 @@
! PR middle-end/39666
! { dg-do compile }
-! { dg-options "-O2 -Wuninitialized" }
+! { dg-options "-O2 -Wmaybe-uninitialized" }
FUNCTION f(n)
INTEGER, INTENT(in) :: n
REAL :: f
SELECT CASE (n)
CASE (:-1); f = -1.0
CASE (0); f = 0.0
CASE (2:); f = 1.0
END SELECT