Commit 31de5e4d by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/89284 (gcc -fsanitize=undefined inhibits -Wuninitialized)

	PR middle-end/89284
	* passes.def: Swap pass_ubsan and pass_early_warn_uninitialized.

	* gcc.dg/ubsan/pr89284.c: New test.

From-SVN: r268862
parent 0ce1c30b
2019-02-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89284
* passes.def: Swap pass_ubsan and pass_early_warn_uninitialized.
2019-02-13 Ian Lance Taylor <iant@golang.org> 2019-02-13 Ian Lance Taylor <iant@golang.org>
* optc-save-gen.awk: Set var_opt_hash for initial optimizations * optc-save-gen.awk: Set var_opt_hash for initial optimizations
......
...@@ -56,8 +56,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -56,8 +56,8 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_fixup_cfg); NEXT_PASS (pass_fixup_cfg);
NEXT_PASS (pass_build_ssa); NEXT_PASS (pass_build_ssa);
NEXT_PASS (pass_warn_nonnull_compare); NEXT_PASS (pass_warn_nonnull_compare);
NEXT_PASS (pass_ubsan);
NEXT_PASS (pass_early_warn_uninitialized); NEXT_PASS (pass_early_warn_uninitialized);
NEXT_PASS (pass_ubsan);
NEXT_PASS (pass_nothrow); NEXT_PASS (pass_nothrow);
NEXT_PASS (pass_rebuild_cgraph_edges); NEXT_PASS (pass_rebuild_cgraph_edges);
POP_INSERT_PASSES () POP_INSERT_PASSES ()
......
2019-02-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/89284
* gcc.dg/ubsan/pr89284.c: New test.
2019-02-13 Ian Lance Taylor <iant@golang.org> 2019-02-13 Ian Lance Taylor <iant@golang.org>
* gcc.dg/func-attr-1.c: New test. * gcc.dg/func-attr-1.c: New test.
......
/* PR middle-end/89284 */
/* { dg-do compile } */
/* { dg-options "-fsanitize=undefined -O0 -Wuninitialized" } */
struct A { _Bool a; int i; };
int
foo (void)
{
struct A a;
if (a.i) /* { dg-warning "'a.i' is used uninitialized in this function" } */
return 1;
return 0;
}
int
bar (void)
{
struct A a;
if (a.a) /* { dg-warning "'a.a' is used uninitialized in this function" } */
return 1;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment