public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch,AVR]: Fix PR48896
@ 2011-05-09 14:15 Georg-Johann Lay
  2011-05-10 13:17 ` Denis Chertykov
  0 siblings, 1 reply; 2+ messages in thread
From: Georg-Johann Lay @ 2011-05-09 14:15 UTC (permalink / raw)
  To: gcc-patches; +Cc: Denis Chertykov, Anatoly Sokolov, Eric Weddington

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

Fixed the build warnings mentioned in PR48896.

Johann

--

2011-05-09  Georg-Johann Lay  <avr@gjlay.de>

	PR target/48896
	* config/avr/avr.c (avr_ret_register): Return unsigned int
	instead of int.
	(avr_function_value): Mark fn_decl_or_type as unused, don't pass
	it to avr_libcall_value.
	avr_expand_builtin): Use EXPAND_NORMAL as arg 4 in calls to
	expand_expr.
	(avr_expand_binop_builtin): Ditto.
	(avr_expand_unop_builtin): Ditto.

[-- Attachment #2: pr48896.diff --]
[-- Type: text/x-patch, Size: 2487 bytes --]

Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c	(Revision 173561)
+++ config/avr/avr.c	(Arbeitskopie)
@@ -6178,7 +6178,7 @@ avr_reorg (void)
 
 /* Returns register number for function return value.*/
 
-static inline int
+static inline unsigned int
 avr_ret_register (void)
 {
   return 24;
@@ -6209,18 +6209,14 @@ avr_libcall_value (enum machine_mode mod
    function returns a value of data type VALTYPE.  */
 
 static rtx
-avr_function_value (const_tree type, const_tree fn_decl_or_type,
-		    bool outgoing ATTRIBUTE_UNUSED)
+avr_function_value (const_tree type,
+                    const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
+                    bool outgoing ATTRIBUTE_UNUSED)
 {
   unsigned int offs;
-  const_rtx func = fn_decl_or_type;
-
-  if (fn_decl_or_type
-      && !DECL_P (fn_decl_or_type))
-  fn_decl_or_type = NULL;
 
   if (TYPE_MODE (type) != BLKmode)
-    return avr_libcall_value (TYPE_MODE (type), func);
+    return avr_libcall_value (TYPE_MODE (type), NULL_RTX);
   
   offs = int_size_in_bytes (type);
   if (offs < 2)
@@ -6711,7 +6707,7 @@ avr_expand_unop_builtin (enum insn_code
 {
   rtx pat;
   tree arg0 = CALL_EXPR_ARG (exp, 0);
-  rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+  rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, EXPAND_NORMAL);
   enum machine_mode op0mode = GET_MODE (op0);
   enum machine_mode tmode = insn_data[icode].operand[0].mode;
   enum machine_mode mode0 = insn_data[icode].operand[1].mode;
@@ -6752,8 +6748,8 @@ avr_expand_binop_builtin (enum insn_code
   rtx pat;
   tree arg0 = CALL_EXPR_ARG (exp, 0);
   tree arg1 = CALL_EXPR_ARG (exp, 1);
-  rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
-  rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
+  rtx op0 = expand_expr (arg0, NULL_RTX, VOIDmode, EXPAND_NORMAL);
+  rtx op1 = expand_expr (arg1, NULL_RTX, VOIDmode, EXPAND_NORMAL);
   enum machine_mode op0mode = GET_MODE (op0);
   enum machine_mode op1mode = GET_MODE (op1);
   enum machine_mode tmode = insn_data[icode].operand[0].mode;
@@ -6845,7 +6841,7 @@ avr_expand_builtin (tree exp, rtx target
     case AVR_BUILTIN_DELAY_CYCLES:
       {
         arg0 = CALL_EXPR_ARG (exp, 0);
-        op0 = expand_expr (arg0, NULL_RTX, VOIDmode, 0);
+        op0 = expand_expr (arg0, NULL_RTX, VOIDmode, EXPAND_NORMAL);
 
         if (! CONST_INT_P (op0))
           error ("__builtin_avr_delay_cycles expects a compile time integer constant.");

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

* Re: [Patch,AVR]: Fix PR48896
  2011-05-09 14:15 [Patch,AVR]: Fix PR48896 Georg-Johann Lay
@ 2011-05-10 13:17 ` Denis Chertykov
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Chertykov @ 2011-05-10 13:17 UTC (permalink / raw)
  To: Georg-Johann Lay; +Cc: gcc-patches, Anatoly Sokolov, Eric Weddington

2011/5/9 Georg-Johann Lay <avr@gjlay.de>:
> Fixed the build warnings mentioned in PR48896.
>
> Johann
>
> --
>
> 2011-05-09  Georg-Johann Lay  <avr@gjlay.de>
>
>        PR target/48896
>        * config/avr/avr.c (avr_ret_register): Return unsigned int
>        instead of int.
>        (avr_function_value): Mark fn_decl_or_type as unused, don't pass
>        it to avr_libcall_value.
>        avr_expand_builtin): Use EXPAND_NORMAL as arg 4 in calls to
>        expand_expr.
>        (avr_expand_binop_builtin): Ditto.
>        (avr_expand_unop_builtin): Ditto.
>

Approved.

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

end of thread, other threads:[~2011-05-10 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-09 14:15 [Patch,AVR]: Fix PR48896 Georg-Johann Lay
2011-05-10 13:17 ` Denis Chertykov

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).