This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fun with argument pointers




When the argument pointer is not a fixed register, it can be used for
other purposes (ie, it can vary).  This patch fixes a few routines
in rtlanal.c to be aware of this fact (and brings it more in line with
how the rest of the compiler handles the argument pointer).

This gets a PA64 bootstrap further, but it's still got some problems
that I haven't sorted out yet.

In the process I noted that we no longer need rtlanal.o for the 
build machine, so I removed the rules to build it.

	* Makefile.in (rtlanal.o): Depend on hard-reg-set.h.
	($HOST_PREFIX_1)rtlanal.o: Remove rules for building
	(mostlyclean): Corresponding changes.
	* rtlanal.c (hard-reg-set.h): Include.
	(rtx_unstable_p): Do not treat the argument pointer specially
	if it is not a fixed register.
	(rtx_varies_p, rtx_addr_can_trap_p): Similarly.
	
	
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.602
diff -c -3 -p -r1.602 Makefile.in
*** Makefile.in	2001/02/12 07:35:01	1.602
--- Makefile.in	2001/02/18 23:56:56
*************** rtl.o : rtl.c $(GCONFIG_H) system.h $(RT
*** 1351,1357 ****
  print-rtl.o : print-rtl.c $(GCONFIG_H) system.h $(RTL_H) hard-reg-set.h \
      $(BASIC_BLOCK_H)
  	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< 
$(OUTPUT_OPTION)
! rtlanal.o : rtlanal.c $(CONFIG_H) system.h toplev.h $(RTL_H)
  errors.o : errors.c $(GCONFIG_H) system.h errors.h
  	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< 
$(OUTPUT_OPTION)
  
--- 1351,1357 ----
  print-rtl.o : print-rtl.c $(GCONFIG_H) system.h $(RTL_H) hard-reg-set.h \
      $(BASIC_BLOCK_H)
  	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< 
$(OUTPUT_OPTION)
! rtlanal.o : rtlanal.c $(CONFIG_H) system.h toplev.h $(RTL_H) hard-reg-set.h
  errors.o : errors.c $(GCONFIG_H) system.h errors.h
  	$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< 
$(OUTPUT_OPTION)
  
*************** $(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitm
*** 1826,1836 ****
  	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c
  	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) 
$(HOST_PREFIX)bitmap.c
  
- $(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) system.h $(RTL_H)
- 	rm -f $(HOST_PREFIX)rtlanal.c
- 	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > 
$(HOST_PREFIX)rtlanal.c
- 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) 
$(HOST_PREFIX)rtlanal.c
- 
  $(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c
  	rm -f $(HOST_PREFIX)alloca.c
  	$(LN_S) $(srcdir)/../libiberty/alloca.c $(HOST_PREFIX)alloca.c
--- 1826,1831 ----
*************** mostlyclean: $(INTL_MOSTLYCLEAN) lang.mo
*** 2286,2292 ****
  	-rm -f $(STAGESTUFF)
  	-rm -rf libgcc
  # Delete the temporary source copies for cross compilation.
! 	-rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
  	-rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
  	-rm -f $(HOST_PREFIX_1)obstack.c
  # Delete the temp files made in the course of building libgcc.a.
--- 2281,2287 ----
  	-rm -f $(STAGESTUFF)
  	-rm -rf libgcc
  # Delete the temporary source copies for cross compilation.
! 	-rm -f $(HOST_PREFIX_1)rtl.c
  	-rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
  	-rm -f $(HOST_PREFIX_1)obstack.c
  # Delete the temp files made in the course of building libgcc.a.
Index: rtlanal.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/rtlanal.c,v
retrieving revision 1.85
diff -c -3 -p -r1.85 rtlanal.c
*** rtlanal.c	2001/02/08 16:24:34	1.85
--- rtlanal.c	2001/02/18 23:56:59
*************** Boston, MA 02111-1307, USA.  */
*** 24,29 ****
--- 24,30 ----
  #include "system.h"
  #include "toplev.h"
  #include "rtl.h"
+ #include "hard-reg-set.h"
  
  static void set_of_1		PARAMS ((rtx, rtx, void *));
  static void insn_dependent_p_1	PARAMS ((rtx, rtx, void *));
*************** rtx_unstable_p (x)
*** 68,74 ****
      case REG:
        /* As in rtx_varies_p, we have to use the actual rtx, not reg number.  
*/
        if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
! 	  || x == arg_pointer_rtx || RTX_UNCHANGING_P (x))
  	return 0;
  #ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
        /* ??? When call-clobbered, the value is stable modulo the restore
--- 69,77 ----
      case REG:
        /* As in rtx_varies_p, we have to use the actual rtx, not reg number.  
*/
        if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
! 	  /* The arg pointer varies if it is not a fixed register.  */
! 	  || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM])
! 	  || RTX_UNCHANGING_P (x))
  	return 0;
  #ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
        /* ??? When call-clobbered, the value is stable modulo the restore
*************** rtx_varies_p (x, for_alias)
*** 144,150 ****
  	 eliminated the frame and/or arg pointer and are using it
  	 for pseudos.  */
        if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
! 	  || x == arg_pointer_rtx)
  	return 0;
        if (x == pic_offset_table_rtx
  #ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
--- 147,154 ----
  	 eliminated the frame and/or arg pointer and are using it
  	 for pseudos.  */
        if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
! 	  /* The arg pointer varies if it is not a fixed register.  */
! 	  || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]))
  	return 0;
        if (x == pic_offset_table_rtx
  #ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
*************** rtx_addr_can_trap_p (x)
*** 212,218 ****
      case REG:
        /* As in rtx_varies_p, we have to use the actual rtx, not reg number.  
*/
        return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
! 		|| x == stack_pointer_rtx || x == arg_pointer_rtx);
  
      case CONST:
        return rtx_addr_can_trap_p (XEXP (x, 0));
--- 216,224 ----
      case REG:
        /* As in rtx_varies_p, we have to use the actual rtx, not reg number.  
*/
        return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
! 		|| x == stack_pointer_rtx
! 		/* The arg pointer varies if it is not a fixed register.  */
! 		|| (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]));
  
      case CONST:
        return rtx_addr_can_trap_p (XEXP (x, 0));









Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]