OSDN Git Service

2010-04-01 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Apr 2010 14:05:49 +0000 (14:05 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Apr 2010 14:05:49 +0000 (14:05 +0000)
PR tree-optimization/43607
* ipa-type-escape.c (check_call): Do not access non-existing
arguments.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157911 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa-type-escape.c

index d1176eb..2e70ef8 100644 (file)
@@ -1,5 +1,11 @@
 2010-04-01  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimization/43607
+       * ipa-type-escape.c (check_call): Do not access non-existing
+       arguments.
+
+2010-04-01  Richard Guenther  <rguenther@suse.de>
+
        PR middle-end/43602
        Revert
        2010-03-30  Seongbae Park <seongbae.park@gmail.com>
index 8d773f1..fa971e4 100644 (file)
@@ -1340,7 +1340,8 @@ check_call (gimple call)
       if (TYPE_ARG_TYPES (TREE_TYPE (callee_t)))
        {
          for (arg_type = TYPE_ARG_TYPES (TREE_TYPE (callee_t)), i = 0;
-              arg_type && TREE_VALUE (arg_type) != void_type_node;
+              arg_type && TREE_VALUE (arg_type) != void_type_node
+              && i < gimple_call_num_args (call);
               arg_type = TREE_CHAIN (arg_type), i++)
            {
              tree operand = gimple_call_arg (call, i);
@@ -1362,7 +1363,7 @@ check_call (gimple call)
             have to do this; the front ends should always process
             the arg list from the TYPE_ARG_LIST. */
          for (arg_type = DECL_ARGUMENTS (callee_t), i = 0;
-              arg_type;
+              arg_type && i < gimple_call_num_args (call);
               arg_type = TREE_CHAIN (arg_type), i++)
            {
              tree operand = gimple_call_arg (call, i);