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]

[3.0] fixes for mips-linux


The mips.h patch is a simpler version of 

2001-05-31  Geoff Keating  <geoffk@cygnus.com>

        * config/mips/mips.h (ASM_OUTPUT_ASCII): Convert to function.
        * config/mips/mips.c (mips_output_ascii): New function.
        * config/mips/mips-protos.h (mips_output_ascii): Prototype.

(which is in mainline only) to avoid variable shadowing in dwarf2asm.c.

The mips.md patch is required for EH to work under the O32 and O64 ABIs.

Ok for branch?


r~


	* config/mips/mips.h (ASM_OUTPUT_ASCII): Rename local variables
	to avoid shadowing parameters.

	* config/mips/mips.md (exception_receiver): New.

Index: mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.108.2.2
diff -c -p -d -r1.108.2.2 mips.h
*** mips.h	2001/05/20 00:31:43	1.108.2.2
--- mips.h	2001/06/14 20:08:53
*************** do {									\
*** 4386,4454 ****
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(STREAM, STRING, LEN)				\
  do {									\
!   register int i, c, len = (LEN), cur_pos = 17;				\
!   register const unsigned char *string =				\
      (const unsigned char *)(STRING);					\
    fprintf ((STREAM), "\t.ascii\t\"");					\
!   for (i = 0; i < len; i++)						\
      {									\
!       register int c = string[i];					\
  									\
!       switch (c)							\
  	{								\
  	case '\"':							\
  	case '\\':							\
  	  putc ('\\', (STREAM));					\
! 	  putc (c, (STREAM));						\
! 	  cur_pos += 2;							\
  	  break;							\
  									\
  	case TARGET_NEWLINE:						\
  	  fputs ("\\n", (STREAM));					\
! 	  if (i+1 < len							\
! 	      && (((c = string[i+1]) >= '\040' && c <= '~')		\
! 		  || c == TARGET_TAB))					\
! 	    cur_pos = 32767;		/* break right here */		\
  	  else								\
! 	    cur_pos += 2;						\
  	  break;							\
  									\
  	case TARGET_TAB:						\
  	  fputs ("\\t", (STREAM));					\
! 	  cur_pos += 2;							\
  	  break;							\
  									\
  	case TARGET_FF:							\
  	  fputs ("\\f", (STREAM));					\
! 	  cur_pos += 2;							\
  	  break;							\
  									\
  	case TARGET_BS:							\
  	  fputs ("\\b", (STREAM));					\
! 	  cur_pos += 2;							\
  	  break;							\
  									\
  	case TARGET_CR:							\
  	  fputs ("\\r", (STREAM));					\
! 	  cur_pos += 2;							\
  	  break;							\
  									\
  	default:							\
! 	  if (c >= ' ' && c < 0177)					\
  	    {								\
! 	      putc (c, (STREAM));					\
! 	      cur_pos++;						\
  	    }								\
  	  else								\
  	    {								\
! 	      fprintf ((STREAM), "\\%03o", c);				\
! 	      cur_pos += 4;						\
  	    }								\
  	}								\
  									\
!       if (cur_pos > 72 && i+1 < len)					\
  	{								\
! 	  cur_pos = 17;							\
  	  fprintf ((STREAM), "\"\n\t.ascii\t\"");			\
  	}								\
      }									\
--- 4386,4454 ----
  #undef ASM_OUTPUT_ASCII
  #define ASM_OUTPUT_ASCII(STREAM, STRING, LEN)				\
  do {									\
!   register int i_, len_ = (LEN), cur_pos_ = 17;				\
!   register const unsigned char *string_ =				\
      (const unsigned char *)(STRING);					\
    fprintf ((STREAM), "\t.ascii\t\"");					\
!   for (i_ = 0; i_ < len_; i_++)						\
      {									\
!       register int c_ = string_[i_];					\
  									\
!       switch (c_)							\
  	{								\
  	case '\"':							\
  	case '\\':							\
  	  putc ('\\', (STREAM));					\
! 	  putc (c_, (STREAM));						\
! 	  cur_pos_ += 2;						\
  	  break;							\
  									\
  	case TARGET_NEWLINE:						\
  	  fputs ("\\n", (STREAM));					\
! 	  if (i_+1 < len_						\
! 	      && (((c_ = string_[i_+1]) >= '\040' && c_ <= '~')		\
! 		  || c_ == TARGET_TAB))					\
! 	    cur_pos_ = 32767;		/* break right here */		\
  	  else								\
! 	    cur_pos_ += 2;						\
  	  break;							\
  									\
  	case TARGET_TAB:						\
  	  fputs ("\\t", (STREAM));					\
! 	  cur_pos_ += 2;						\
  	  break;							\
  									\
  	case TARGET_FF:							\
  	  fputs ("\\f", (STREAM));					\
! 	  cur_pos_ += 2;						\
  	  break;							\
  									\
  	case TARGET_BS:							\
  	  fputs ("\\b", (STREAM));					\
! 	  cur_pos_ += 2;						\
  	  break;							\
  									\
  	case TARGET_CR:							\
  	  fputs ("\\r", (STREAM));					\
! 	  cur_pos_ += 2;						\
  	  break;							\
  									\
  	default:							\
! 	  if (c_ >= ' ' && c_ < 0177)					\
  	    {								\
! 	      putc (c_, (STREAM));					\
! 	      cur_pos_++;						\
  	    }								\
  	  else								\
  	    {								\
! 	      fprintf ((STREAM), "\\%03o", c_);				\
! 	      cur_pos_ += 4;						\
  	    }								\
  	}								\
  									\
!       if (cur_pos_ > 72 && i_+1 < len_)					\
  	{								\
! 	  cur_pos_ = 17;						\
  	  fprintf ((STREAM), "\"\n\t.ascii\t\"");			\
  	}								\
      }									\
Index: mips.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.md,v
retrieving revision 1.87.4.2
diff -c -p -d -r1.87.4.2 mips.md
*** mips.md	2001/05/20 00:31:43	1.87.4.2
--- mips.md	2001/06/14 20:08:53
***************
*** 30,42 ****
  ;; Number	USE
  ;; 0		movsi_ul
  ;; 1		movsi_us, get_fnaddr
- ;; 2		loadgp
  ;; 3		eh_set_return
  ;; 20		builtin_setjmp_setup
  ;;
  ;; UNSPEC_VOLATILE values
  ;; 0		blockage
  ;; 3		builtin_longjmp
  ;; 10		consttable_qi
  ;; 11		consttable_hi
  ;; 12		consttable_si
--- 30,43 ----
  ;; Number	USE
  ;; 0		movsi_ul
  ;; 1		movsi_us, get_fnaddr
  ;; 3		eh_set_return
  ;; 20		builtin_setjmp_setup
  ;;
  ;; UNSPEC_VOLATILE values
  ;; 0		blockage
+ ;; 2		loadgp
  ;; 3		builtin_longjmp
+ ;; 4		exception_receiver
  ;; 10		consttable_qi
  ;; 11		consttable_hi
  ;; 12		consttable_si
*************** ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j
*** 9555,9560 ****
--- 9556,9581 ----
  		  operands[0]);
    DONE;
  }")
+ 
+ (define_insn "exception_receiver"
+   [(unspec_volatile [(const_int 0)] 4)]
+   "TARGET_ABICALLS && (mips_abi == ABI_32 || mips_abi == ABI_O64)"
+   "*
+ {
+   rtx loc;
+ 
+   operands[0] = pic_offset_table_rtx;
+   if (frame_pointer_needed)
+     loc = hard_frame_pointer_rtx;
+   else
+     loc = stack_pointer_rtx;
+   loc = plus_constant (loc, current_frame_info.args_size);
+   operands[1] = gen_rtx_MEM (Pmode, loc);
+ 
+   return mips_move_1word (operands, insn, 0);
+ }"
+   [(set_attr "type"   "load")
+    (set_attr "length" "8")])
  
  ;;
  ;;  ....................


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