diff options
author | Nathan Sidwell <nathan@acm.org> | 2018-02-09 19:31:10 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2018-02-09 19:31:10 +0000 |
commit | 0444aa9c0a3357707624263ec2fd13d8f156016e (patch) | |
tree | dfe37130c665a88b85c0d08c740c2ba447b3cedc /gcc/testsuite/c-c++-common/pr84293.c | |
parent | dd2799cc2212a72a1b31828918f9bb9287ab9780 (diff) | |
download | gcc-0444aa9c0a3357707624263ec2fd13d8f156016e.zip gcc-0444aa9c0a3357707624263ec2fd13d8f156016e.tar.gz gcc-0444aa9c0a3357707624263ec2fd13d8f156016e.tar.bz2 |
[PR c/84293] Unexpected strict-alias warning
https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00510.html
PR c/84293
gcc/c/
* c-typeck.c (build_indirect_ref, build_c_cast): Pass expr location
to strict_aliasing_warning.
gcc/c-family/
* c-common.h (strict_aliasing_warning): Drop OTYPE arg, insert LOC
arg.
* c-warn.c (strict_aliasing_warning): Drop OTYPE arg, require LOC
arg. Adjust.
gcc/cp/
* typeck.c (cp_build_indirect_ref_1, build_reinterpret_cast_1):
Pass expr location to strict_aliasing_warning.
gcc/testsuite/
* c-c++-common/pr84293.h: New.
* c-c++-common/pr84293.c: New.
From-SVN: r257539
Diffstat (limited to 'gcc/testsuite/c-c++-common/pr84293.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/pr84293.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/pr84293.c b/gcc/testsuite/c-c++-common/pr84293.c new file mode 100644 index 0000000..dfcc859 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr84293.c @@ -0,0 +1,10 @@ +/* PR c/84293 unexpected warning from system header. */ +#include "./pr84293.h" +struct typeobject thing; + +#pragma GCC diagnostic warning "-Wstrict-aliasing" +void __attribute__ ((optimize (2))) init () +{ + INCREF_TDEF (&thing); + INCREF_STAG (&thing); +} |