public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR target/16379
@ 2004-07-06  9:01 Kazuhiro Inaoka
  2004-07-07 11:46 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Kazuhiro Inaoka @ 2004-07-06  9:01 UTC (permalink / raw)
  To: Nick Clifton; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

Hi, Nick

This is a patch to fix PR target/1679
Please apply it.

Please commit into 3.4-branch and mainline.

Regards,

Kazuhiro Inaoka

gcc/ChangeLog

2004-07-06  Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>

	* config/m32r/m32r.c (function_symbol): Added. For PR
	target/1679.
	(block_move_call): Changed.
	* config/m32r/m32r-protos.h (function_symbol): Added.
	* config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Changed.





[-- Attachment #2: func_sym.patch --]
[-- Type: text/plain, Size: 4080 bytes --]

Index: m32r-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r-protos.h,v
retrieving revision 1.21.4.2
diff -c -r1.21.4.2 m32r-protos.h
*** m32r-protos.h	15 Jun 2004 10:15:14 -0000	1.21.4.2
--- m32r-protos.h	6 Jul 2004 07:57:19 -0000
***************
*** 59,64 ****
--- 59,65 ----
  extern int    m32r_legitimate_pic_operand_p (rtx);
  extern rtx    m32r_legitimize_pic_address (rtx, rtx);
  extern rtx    m32r_return_addr (int);
+ extern rtx    function_symbol (const char *);
  
  #ifdef HAVE_MACHINE_MODES
  extern int    call_address_operand (rtx, Mmode);
Index: m32r.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r.c,v
retrieving revision 1.80.4.2
diff -c -r1.80.4.2 m32r.c
*** m32r.c	15 Jun 2004 10:15:14 -0000	1.80.4.2
--- m32r.c	6 Jul 2004 07:57:19 -0000
***************
*** 2754,2759 ****
--- 2754,2781 ----
  
  \f
  /* Use a library function to move some bytes.  */
+ rtx
+ function_symbol (const char *name)
+ {
+   int extra_flags = 0;
+   enum m32r_model model;
+   rtx sym = gen_rtx_SYMBOL_REF (Pmode, name);
+ 
+   if (TARGET_MODEL_SMALL)
+     model = M32R_MODEL_SMALL;
+   else if (TARGET_MODEL_MEDIUM)
+     model = M32R_MODEL_MEDIUM;
+   else if (TARGET_MODEL_LARGE)
+     model = M32R_MODEL_LARGE;
+   else
+     abort (); /* shouldn't happen */
+   extra_flags |= model << SYMBOL_FLAG_MODEL_SHIFT;
+                                                                                 
+   if (extra_flags)
+     SYMBOL_REF_FLAGS (sym) |= extra_flags;
+ 
+   return sym;
+ }
  
  static void
  block_move_call (rtx dest_reg, rtx src_reg, rtx bytes_rtx)
***************
*** 2765,2777 ****
      bytes_rtx = convert_to_mode (Pmode, bytes_rtx, 1);
  
  #ifdef TARGET_MEM_FUNCTIONS
!   emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "memcpy"), 0,
  		     VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode,
  		     convert_to_mode (TYPE_MODE (sizetype), bytes_rtx,
  				      TREE_UNSIGNED (sizetype)),
  		     TYPE_MODE (sizetype));
  #else
!   emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "bcopy"), 0,
  		     VOIDmode, 3, src_reg, Pmode, dest_reg, Pmode,
  		     convert_to_mode (TYPE_MODE (integer_type_node), bytes_rtx,
  				      TREE_UNSIGNED (integer_type_node)),
--- 2787,2800 ----
      bytes_rtx = convert_to_mode (Pmode, bytes_rtx, 1);
  
  #ifdef TARGET_MEM_FUNCTIONS
!   /* emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "memcpy"), 0, */
!   emit_library_call (function_symbol ("memcpy"), 0,
  		     VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode,
  		     convert_to_mode (TYPE_MODE (sizetype), bytes_rtx,
  				      TREE_UNSIGNED (sizetype)),
  		     TYPE_MODE (sizetype));
  #else
!   emit_library_call (function_symbol ("bcopy"), 0,
  		     VOIDmode, 3, src_reg, Pmode, dest_reg, Pmode,
  		     convert_to_mode (TYPE_MODE (integer_type_node), bytes_rtx,
  				      TREE_UNSIGNED (integer_type_node)),
Index: m32r.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r.h,v
retrieving revision 1.99.4.4
diff -c -r1.99.4.4 m32r.h
*** m32r.h	15 Jun 2004 10:15:15 -0000	1.99.4.4
--- m32r.h	6 Jul 2004 07:57:19 -0000
***************
*** 1298,1304 ****
  	emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)),\
  				     GEN_INT (m32r_cache_flush_trap) ));	\
        else if (m32r_cache_flush_func && m32r_cache_flush_func[0])		\
! 	emit_library_call (gen_rtx_SYMBOL_REF (Pmode, m32r_cache_flush_func), 	\
  			   0, VOIDmode, 3, TRAMP, Pmode,			\
  			   GEN_INT (TRAMPOLINE_SIZE), SImode,			\
  			   GEN_INT (3), SImode);				\
--- 1298,1304 ----
  	emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)),\
  				     GEN_INT (m32r_cache_flush_trap) ));	\
        else if (m32r_cache_flush_func && m32r_cache_flush_func[0])		\
! 	emit_library_call (function_symbol (m32r_cache_flush_func), 	\
  			   0, VOIDmode, 3, TRAMP, Pmode,			\
  			   GEN_INT (TRAMPOLINE_SIZE), SImode,			\
  			   GEN_INT (3), SImode);				\

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix PR target/16379
  2004-07-06  9:01 [PATCH] Fix PR target/16379 Kazuhiro Inaoka
@ 2004-07-07 11:46 ` Nick Clifton
  2004-07-08  1:17   ` Kazuhiro Inaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2004-07-07 11:46 UTC (permalink / raw)
  To: Kazuhiro Inaoka; +Cc: gcc-patches

Hi Kazuhiro,

> This is a patch to fix PR target/1679
> Please apply it.
> 
> Please commit into 3.4-branch and mainline.

> 2004-07-06  Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>
> 
> 	* config/m32r/m32r.c (function_symbol): Added. For PR
> 	target/1679.
> 	(block_move_call): Changed.
> 	* config/m32r/m32r-protos.h (function_symbol): Added.
> 	* config/m32r/m32r.h (INITIALIZE_TRAMPOLINE): Changed.

I have applied this patch to the 3.4 branch and mainline.  I made one 
small change.  I renamed the new function to "m32r_function_symbol" in 
order to be consistent with the naming convention for other exported 
functions in the m32r.c file and also so that if the function name is 
encountered in a debugger the user will know that it is an m32r specific 
function and not a generic gcc function.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix PR target/16379
  2004-07-07 11:46 ` Nick Clifton
@ 2004-07-08  1:17   ` Kazuhiro Inaoka
  0 siblings, 0 replies; 3+ messages in thread
From: Kazuhiro Inaoka @ 2004-07-08  1:17 UTC (permalink / raw)
  To: Nick Clifton; +Cc: gcc-patches

Thanks!
Kazuhiro Inaoka

> I have applied this patch to the 3.4 branch and mainline.  I made one 
> small change.  I renamed the new function to "m32r_function_symbol" in 
> order to be consistent with the naming convention for other exported 
> functions in the m32r.c file and also so that if the function name is 
> encountered in a debugger the user will know that it is an m32r specific 
> function and not a generic gcc function.
> 
> Cheers
>   Nick


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-08  0:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-06  9:01 [PATCH] Fix PR target/16379 Kazuhiro Inaoka
2004-07-07 11:46 ` Nick Clifton
2004-07-08  1:17   ` Kazuhiro Inaoka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).