Commit efbf55b0 by Marek Polacek Committed by Marek Polacek

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
parent f0622a50
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.
2017-06-28 Martin Liska <mliska@suse.cz>
......
......@@ -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;
......
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
......
/* 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" } */
}
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