@@ -1862,7 +1862,6 @@ arc_setup_incoming_varargs (cumulative_args_t args_so_far,
18621862 int first_anon_arg ;
18631863 CUMULATIVE_ARGS next_cum ;
18641864
1865-
18661865 if (TARGET_HS )
18671866 {
18681867 * pretend_size = 0 ;
@@ -1872,10 +1871,10 @@ arc_setup_incoming_varargs (cumulative_args_t args_so_far,
18721871 /* We must treat `__builtin_va_alist' as an anonymous arg. */
18731872
18741873 next_cum = * get_cumulative_args (args_so_far );
1875- arc_function_arg_advance (pack_cumulative_args (& next_cum ), mode , type , 1 );
1874+ arc_function_arg_advance (pack_cumulative_args (& next_cum ), mode , type , true );
18761875 first_anon_arg = next_cum .arg_num ;
18771876
1878- if (first_anon_arg < MAX_ARC_PARM_REGS )
1877+ if (FUNCTION_ARG_REGNO_P ( first_anon_arg ) )
18791878 {
18801879 /* First anonymous (unnamed) argument is in a reg. */
18811880
@@ -5250,10 +5249,10 @@ static rtx
52505249arc_function_args_impl (CUMULATIVE_ARGS * cum ,
52515250 enum machine_mode mode ,
52525251 const_tree type ,
5253- int named ,
5252+ bool named ,
52545253 bool advance )
52555254{
5256- int reg_idx = 0 ;
5255+ int lb , reg_idx = 0 ;
52575256 int reg_location = 0 ;
52585257 int nregs ;
52595258 bool found = false;
@@ -5297,7 +5296,8 @@ arc_function_args_impl (CUMULATIVE_ARGS *cum,
52975296 if (advance )
52985297 {
52995298 /* Update CUMULATIVE_ARGS if we advance. */
5300- for (reg_idx = reg_location ; (reg_idx < (reg_location + nregs ))
5299+ lb = (arc_abi == ARC_ABI_PACK ) ? reg_location : 0 ;
5300+ for (reg_idx = lb ; (reg_idx < (reg_location + nregs ))
53015301 && FUNCTION_ARG_REGNO_P (reg_idx ); reg_idx ++ )
53025302 {
53035303 cum -> avail [reg_idx ] = false;
0 commit comments