[patch] Fix vararg addressing for the v850

Catherine Moore clm@redhat.com
Wed Jul 25 10:54:00 GMT 2001


This patch corrects a problem with generating code for
varargs on the v850.  The incorrect stack address was
being generated.  I ran the gcc torture tests for the
v850-elf and I no longer have vararg-related failures.
Okay to install?

2001-07-25  Catherine Moore  <clm@redhat.com>

	* config/v850/v850.c (v850_va_arg):  Use addr
	instead of valist to build incr.

Index: v850.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/v850/v850.c,v
retrieving revision 1.46
diff -p -r1.46 v850.c
*** v850.c      2001/07/11 20:35:55     1.46
--- v850.c      2001/07/25 17:48:04
*************** v850_va_arg (valist, type)
*** 2778,2784 ****
      }
  
    addr = save_expr (valist);
!   incr = fold (build (PLUS_EXPR, ptr_type_node, valist,
                      build_int_2 (rsize, 0)));
  
    incr = build (MODIFY_EXPR, ptr_type_node, valist, incr);
--- 2778,2784 ----
      }
  
    addr = save_expr (valist);
!   incr = fold (build (PLUS_EXPR, ptr_type_node, addr,
                      build_int_2 (rsize, 0)));
  
    incr = build (MODIFY_EXPR, ptr_type_node, valist, incr);



More information about the Gcc-patches mailing list