http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59309

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bviyer at gmail dot com

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
There are

  /* This should give the number of parameters.  */
  total_args = list_length (new_args);
  arg_array = XNEWVEC (tree, total_args);

  ii_args = new_args;
  for (ii = 0; ii < total_args; ii++)
    {    
      arg_array[ii] = TREE_VALUE (ii_args);
      ii_args = TREE_CHAIN (ii_args);
    }    

  TREE_USED (function) = 1; 
  rest_of_decl_compilation (function, 0, 0);

  call1 = cilk_call_setjmp (cfun->cilk_frame_decl);

  if (*arg_array == NULL_TREE)
    call2 = build_call_expr (function, 0);
  else 
    call2 = build_call_expr_loc_array (EXPR_LOCATION (*spawn_p), function, 
                                         total_args, arg_array);

When total_args == 0, XNEWVEC (tree, total_args) doesn't return
NULL and "*arg_array" will be wrong.

Reply via email to