Commit 5147d10a by Marek Polacek Committed by Marek Polacek

re PR middle-end/59827 (ICE on array with incomplete element type)

	PR middle-end/59827
	* cgraph.c (gimple_check_call_args): Don't use DECL_ARG_TYPE if
	it is error_mark_node.
testsuite/
	* gcc.dg/pr59827.c: New test.

From-SVN: r206660
parent 1a22d3cb
2014-01-16 Marek Polacek <polacek@redhat.com>
PR middle-end/59827
* cgraph.c (gimple_check_call_args): Don't use DECL_ARG_TYPE if
it is error_mark_node.
2014-01-15 Uros Bizjak <ubizjak@gmail.com> 2014-01-15 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_hard_regno_mode_ok): Use * config/i386/i386.c (ix86_hard_regno_mode_ok): Use
......
...@@ -3035,6 +3035,7 @@ gimple_check_call_args (gimple stmt, tree fndecl, bool args_count_match) ...@@ -3035,6 +3035,7 @@ gimple_check_call_args (gimple stmt, tree fndecl, bool args_count_match)
break; break;
arg = gimple_call_arg (stmt, i); arg = gimple_call_arg (stmt, i);
if (p == error_mark_node if (p == error_mark_node
|| DECL_ARG_TYPE (p) == error_mark_node
|| arg == error_mark_node || arg == error_mark_node
|| (!types_compatible_p (DECL_ARG_TYPE (p), TREE_TYPE (arg)) || (!types_compatible_p (DECL_ARG_TYPE (p), TREE_TYPE (arg))
&& !fold_convertible_p (DECL_ARG_TYPE (p), arg))) && !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
......
2014-01-16 Marek Polacek <polacek@redhat.com>
PR middle-end/59827
* gcc.dg/pr59827.c: New test.
2014-01-16 Andreas Schwab <schwab@linux-m68k.org> 2014-01-16 Andreas Schwab <schwab@linux-m68k.org>
* gcc.c-torture/execute/pr59747.c (fn1): Return a value. * gcc.c-torture/execute/pr59747.c (fn1): Return a value.
......
/* PR middle-end/59827 */
/* { dg-do compile } */
int
foo (int p[2][]) /* { dg-error "array type has incomplete element type" } */
{
return p[0][0];
}
void
bar (void)
{
int p[2][1];
foo (p); /* { dg-error "type of formal parameter 1 is incomplete" } */
}
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