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] alias.c: Replace "return NULL_RTX" with "return 0".


Hi,

Attached is a patch to replace "return NULL_RTX" with "return 0".

In the past, there were some arguments to prefer 0 to NULL_RTX, such
as

http://gcc.gnu.org/ml/gcc-patches/2001-03/msg01566.html

One of the problems that were pointed out was that arguments to
variadic functions need to be typed, but return values should have no
problem because they are always typed.

I could do a massive automated replace, but I chose to manually check
the actual return type just in case and go through files one by one.

Bootstrapped on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2003-06-12  Kazu Hirata  <kazu@cs.umass.edu>

	* alias.c: Replace "return NULL_RTX" with "return 0".

Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.193
diff -u -r1.193 alias.c
--- alias.c	20 May 2003 01:49:07 -0000	1.193
+++ alias.c	12 Jun 2003 16:12:22 -0000
@@ -1825,7 +1825,7 @@
 
 /* Returns MEM1 if and only if MEM1 is a scalar at a fixed address and
    MEM2 is a reference to a structure at a varying address, or returns
-   MEM2 if vice versa.  Otherwise, returns NULL_RTX.  If a non-NULL
+   MEM2 if vice versa.  Otherwise, returns 0.  If a non-NULL
    value is returned MEM1 and MEM2 can never alias.  VARIES_P is used
    to decide whether or not an address may vary; it should return
    nonzero whenever variation is possible.
@@ -1838,7 +1838,7 @@
      int (*varies_p) PARAMS ((rtx, int));
 {
   if (! flag_strict_aliasing)
-    return NULL_RTX;
+    return 0;
 
   if (MEM_SCALAR_P (mem1) && MEM_IN_STRUCT_P (mem2)
       && !varies_p (mem1_addr, 1) && varies_p (mem2_addr, 1))
@@ -1852,7 +1852,7 @@
        varying address.  */
     return mem2;
 
-  return NULL_RTX;
+  return 0;
 }
 
 /* Returns nonzero if something about the mode or address format MEM1
@@ -1954,7 +1954,7 @@
   HOST_WIDE_INT ioffset;
 
   if (! offset)
-    return NULL_RTX;
+    return 0;
 
   ioffset = INTVAL (offset);
   do
@@ -1962,7 +1962,7 @@
       tree field = TREE_OPERAND (x, 1);
 
       if (! host_integerp (DECL_FIELD_OFFSET (field), 1))
-	return NULL_RTX;
+	return 0;
       ioffset += (tree_low_cst (DECL_FIELD_OFFSET (field), 1)
 		  + (tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1)
 		     / BITS_PER_UNIT));


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