Commit ac4eb40f by Mikhail Maltsev Committed by Mikhail Maltsev

GIMPLEFE: Handle invalid unary "*" operand type

gcc/c/

	PR testsuite/80580
	* gimple-parser.c (c_parser_gimple_unary_expression): Check argument
	type of unary '*'.

gcc/testsuite/

	PR testsuite/80580
	* gcc.dg/gimplefe-error-4.c: New test.

From-SVN: r247899
parent ab9e91f9
2017-05-11 Mikhail Maltsev <maltsevm@gmail.com>
PR testsuite/80580
* gimple-parser.c (c_parser_gimple_unary_expression): Check argument
type of unary '*'.
2017-05-09 Nathan Sidwell <nathan@acm.org>
* c-tree.h (pushdecl): Declare.
......
......@@ -567,6 +567,11 @@ c_parser_gimple_unary_expression (c_parser *parser)
op = c_parser_gimple_postfix_expression (parser);
if (op.value == error_mark_node)
return ret;
if (! POINTER_TYPE_P (TREE_TYPE (op.value)))
{
error_at (op_loc, "expected pointer as argument of unary %<*%>");
return ret;
}
finish = op.get_finish ();
location_t combined_loc = make_location (op_loc, op_loc, finish);
ret.value = build_simple_mem_ref_loc (combined_loc, op.value);
......
2017-05-11 Mikhail Maltsev <maltsevm@gmail.com>
PR testsuite/80580
* gcc.dg/gimplefe-error-4.c: New test.
2017-05-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.target/powerpc/p8-vec-xl-xst.c: New file.
......
/* { dg-do compile } */
/* { dg-options "-fgimple" } */
__GIMPLE() void a()
{
*0 = 1; /* { dg-error "expected pointer" } */
}
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