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]
Other format: [Raw text]

[patch] h8300.c: Remove redundant code.


Hi,

Attached is a patch to remove redundant code from h8300.c.

Tested on h8300 port.  Committed.

Kazu Hirata

2002-01-21  Kazu Hirata  <kazu@hxi.com>

	* config/h8300/h8300.c (function_arg): Replace 0 with NULL_RTX
	as appropriate.
	Remove redundant code.

Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.97
diff -u -r1.97 h8300.c
--- h8300.c	2002/01/21 02:04:46	1.97
+++ h8300.c	2002/01/21 07:04:50
@@ -825,20 +825,19 @@
      tree type;
      int named;
 {
-  rtx result = 0;
+  rtx result = NULL_RTX;
   const char *fname;
   int regpass = 0;
 
   /* Never pass unnamed arguments in registers.  */
   if (!named)
-    return 0;
+    return NULL_RTX;
 
   /* Pass 3 regs worth of data in regs when user asked on the command line.  */
   if (TARGET_QUICKCALL)
     regpass = 3;
 
   /* If calling hand written assembler, use 4 regs of args.  */
-
   if (cum->libcall)
     {
       const char * const *p;
@@ -846,7 +845,6 @@
       fname = XSTR (cum->libcall, 0);
 
       /* See if this libcall is one of the hand coded ones.  */
-
       for (p = hand_list; *p && strcmp (*p, fname) != 0; p++)
 	;
 
@@ -863,11 +861,7 @@
       else
 	size = GET_MODE_SIZE (mode);
 
-      if (size + cum->nbytes > regpass * UNITS_PER_WORD)
-	{
-	  result = 0;
-	}
-      else
+      if (size + cum->nbytes <= regpass * UNITS_PER_WORD)
 	{
 	  switch (cum->nbytes / UNITS_PER_WORD)
 	    {
@@ -883,8 +877,6 @@
 	    case 3:
 	      result = gen_rtx_REG (mode, 3);
 	      break;
-	    default:
-	      result = 0;
 	    }
 	}
     }


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