diff options
author | Marek Polacek <polacek@redhat.com> | 2016-08-18 16:38:49 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-08-18 16:38:49 +0000 |
commit | a76989dc7c9236214856db196da88a739f0e7baa (patch) | |
tree | 3ee35cf53621a4d475bebb671b56ce36af2f079e /gcc/testsuite/gcc.dg | |
parent | f87e22c52128d9d9c9a72a81ae3922b46ce52e59 (diff) | |
download | gcc-a76989dc7c9236214856db196da88a739f0e7baa.zip gcc-a76989dc7c9236214856db196da88a739f0e7baa.tar.gz gcc-a76989dc7c9236214856db196da88a739f0e7baa.tar.bz2 |
re PR c/71514 (ICE on C11 code with atomic exchange at -O1 and above on x86_64-linux-gnu: in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:879)
PR c/71514
* c-common.c (get_atomic_generic_size): Disallow pointer-to-function
and pointer-to-VLA.
* gcc.dg/pr71514.c: New test.
From-SVN: r239581
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr71514.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr71514.c b/gcc/testsuite/gcc.dg/pr71514.c new file mode 100644 index 0000000..8bfa805 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr71514.c @@ -0,0 +1,23 @@ +/* PR c/71514 */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +void +foo () +{ +} + +int a, b; + +void +fn1 (void) +{ + __atomic_exchange (&a, &foo, &b, __ATOMIC_RELAXED); /* { dg-error "must not be a pointer to a function" } */ +} + +void +fn2 (int n) +{ + int arr[n]; + __atomic_exchange (&a, &arr, &b, __ATOMIC_RELAXED); /* { dg-error "must be a pointer to a constant size type" } */ +} |