re PR c/81231 (ICE with invalid argument to __atomic_*)
PR c/81231 * c-common.c (sync_resolve_size): Give error for pointers to incomplete types. * gcc.dg/atomic-pr81231.c: New test. From-SVN: r249963
This commit is contained in:
parent
f0622a50ee
commit
efbf55b01c
4 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2017-07-04 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c/81231
|
||||
* c-common.c (sync_resolve_size): Give error for pointers to incomplete
|
||||
types.
|
||||
|
||||
2017-07-04 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
* c-warn.c (warn_if_unused_value): Remove WITH_CLEANUP_EXPR handling.
|
||||
|
|
|
@ -6485,6 +6485,9 @@ sync_resolve_size (tree function, vec<tree, va_gc> *params, bool fetch)
|
|||
if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
|
||||
goto incompatible;
|
||||
|
||||
if (!COMPLETE_TYPE_P (type))
|
||||
goto incompatible;
|
||||
|
||||
if (fetch && TREE_CODE (type) == BOOLEAN_TYPE)
|
||||
goto incompatible;
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2017-07-04 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c/81231
|
||||
* gcc.dg/atomic-pr81231.c: New test.
|
||||
|
||||
2017-07-04 Richard Sandiford <richard.sandiford@linaro.org>
|
||||
|
||||
PR tree-optimization/81292
|
||||
|
|
12
gcc/testsuite/gcc.dg/atomic-pr81231.c
Normal file
12
gcc/testsuite/gcc.dg/atomic-pr81231.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* PR c/81231 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "" } */
|
||||
|
||||
enum E;
|
||||
|
||||
void
|
||||
foo (void)
|
||||
{
|
||||
__atomic_load_n ((enum E *) 0, 0); /* { dg-error "incompatible" } */
|
||||
__atomic_load_n ((enum X *) 0, 0); /* { dg-error "incompatible" } */
|
||||
}
|
Loading…
Add table
Reference in a new issue