OSDN Git Service

PR middle-end/44204
authorfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 May 2010 13:17:04 +0000 (13:17 +0000)
committerfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 May 2010 13:17:04 +0000 (13:17 +0000)
* 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

gcc/ChangeLog
gcc/builtins.c

index 276c80c..0368081 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-21  Nathan Froyd  <froydnj@codesourcery.com>
+
+       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  <kai.tietz@onevision.com>
 
        PR/44139
index 6ad95ad..2c9d750 100644 (file)
@@ -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
        {