From: froydnj Date: Fri, 21 May 2010 13:17:04 +0000 (+0000) Subject: PR middle-end/44204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b67573db460a8d652e9bd9c7ec3da8782bd0c099;p=thirdparty%2Fgcc.git PR middle-end/44204 * builtins.c (fold_call_stmt): Pass &error_mark_node if the call statement has no arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159662 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 276c80ca44ab..036808189368 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-05-21 Nathan Froyd + + PR middle-end/44204 + * builtins.c (fold_call_stmt): Pass &error_mark_node if the call + statement has no arguments. + 2010-05-21 Kai Tietz PR/44139 diff --git a/gcc/builtins.c b/gcc/builtins.c index 6ad95adbc00b..2c9d75095572 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -13699,7 +13699,9 @@ fold_call_stmt (gimple stmt, bool ignore) if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) { return targetm.fold_builtin (fndecl, nargs, - gimple_call_arg_ptr (stmt, 0), ignore); + (nargs > 0 + ? gimple_call_arg_ptr (stmt, 0) + : &error_mark_node), ignore); } else {