fix INIT_CUMULATIVE_ARGS for split_complex on rs6000

Joern Rennecke joern.rennecke@superh.com
Thu Jun 3 17:26:00 GMT 2004


> Index: gcc/calls.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/calls.c,v
> retrieving revision 1.315.2.1
> diff -u -p -r1.315.2.1 calls.c
> --- gcc/calls.c	23 Jan 2004 23:35:53 -0000	1.315.2.1
> +++ gcc/calls.c	2 Feb 2004 13:15:08 -0000
> @@ -2395,14 +2395,6 @@ expand_call (tree exp, rtx target, int i
>    for (p = actparms, num_actuals = 0; p; p = TREE_CHAIN (p))
>      num_actuals++;
>  
> -  /* Start updating where the next arg would go.
> -
> -     On some machines (such as the PA) indirect calls have a different
> -     calling convention than normal calls.  The last argument in
> -     INIT_CUMULATIVE_ARGS tells the backend if this is an indirect call
> -     or not.  */
> -  INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl);
> -
>    /* Compute number of named args.
>       Normally, don't include the last named arg if anonymous args follow.
>       We do include the last named arg if
> @@ -2434,6 +2426,14 @@ expand_call (tree exp, rtx target, int i
>      /* If we know nothing, treat all args as named.  */
>      n_named_args = num_actuals;
>  
> +  /* Start updating where the next arg would go.
> +
> +     On some machines (such as the PA) indirect calls have a different
> +     calling convention than normal calls.  The last argument in
> +     INIT_CUMULATIVE_ARGS tells the backend if this is an indirect call
> +     or not.  */
> +  INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl, n_named_args);
> +
>    /* Make a vector to hold all the information about each arg.  */
>    args = alloca (num_actuals * sizeof (struct arg_data));
>    memset (args, 0, num_actuals * sizeof (struct arg_data));
> @@ -3777,7 +3777,7 @@ emit_library_call_value_1 (int retval, r
>  #ifdef INIT_CUMULATIVE_LIBCALL_ARGS
>    INIT_CUMULATIVE_LIBCALL_ARGS (args_so_far, outmode, fun);
>  #else
> -  INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun, 0);
> +  INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun, 0, nargs);
>  #endif
>  
>    args_size.constant = 0;

n_named_args is comuted using args_so_far.  You have moved the initialization
of that variable below the first use.
I don't see any sane way to implement your new INIT_CUMULATIVE_ARGS semantics.



More information about the Gcc-patches mailing list