Avoid direct use of GO_IF_LEGITIMATE_ADDRESS

Richard Earnshaw rearnsha@gcc.gnu.org
Mon Aug 9 18:00:00 GMT 2004


On Mon, 2004-08-09 at 18:43, Zack Weinberg wrote:

> Index: recog.c
> --- recog.c	3 Aug 2004 23:37:32 -0000	1.208
> +++ recog.c	9 Aug 2004 17:41:18 -0000
> @@ -975,14 +975,11 @@ general_operand (rtx op, enum machine_mo
>  	return 0;
>  
>        /* Use the mem's mode, since it will be reloaded thus.  */
> -      mode = GET_MODE (op);
> -      GO_IF_LEGITIMATE_ADDRESS (mode, y, win);
> +      if (memory_address_p (GET_MODE (op), y))
> +	return 1;
>      }
>  
>    return 0;
> -
> - win:
> -  return 1;
>  }
>  

Why not just 

        return 0;
 
       /* Use the mem's mode, since it will be reloaded thus.  */
-      mode = GET_MODE (op);
-      GO_IF_LEGITIMATE_ADDRESS (mode, y, win);
+      return memory_address_p (GET_MODE (op), y);
     }
 
   return 0;
-
- win:
-  return 1;
 }

since memory_address_p returns 0 or 1 anyway and this makes it a
tail-call.

R.



More information about the Gcc-patches mailing list