diff mbox

Remove some unnecessary null checks in df.h

Message ID 87bntvs1j3.fsf@talisman.default
State New
Headers show

Commit Message

Richard Sandiford June 14, 2014, 8:02 p.m. UTC
DF_REF_REG_USE_P and DF_MWS_REG_USE_P checked for null arguments
but the def equivalents didn't.  There doesn't seem to be any
need for this difference.

Tested on x86_64-linux-gnu.  OK to install?

Thanks,
Richard


gcc/
	* df.h (DF_REF_REG_USE_P, DF_MWS_REG_USE_P): Remove null checks.

Comments

Steven Bosscher June 14, 2014, 8:26 p.m. UTC | #1
On Sat, Jun 14, 2014 at 10:02 PM, Richard Sandiford wrote:
> DF_REF_REG_USE_P and DF_MWS_REG_USE_P checked for null arguments
> but the def equivalents didn't.  There doesn't seem to be any
> need for this difference.

Right, looking at the users (one user for each) of these macros, I
don't think REF ever can be NULL.

> gcc/
>         * df.h (DF_REF_REG_USE_P, DF_MWS_REG_USE_P): Remove null checks.


OK.

Ciao!
Steven
diff mbox

Patch

Index: gcc/df.h
===================================================================
--- gcc/df.h	2014-06-13 09:50:18.408426173 +0100
+++ gcc/df.h	2014-06-13 10:03:38.465506737 +0100
@@ -678,14 +678,14 @@  #define DF_REF_EXTRACT_MODE(REF) ((REF)-
 
 /* Macros to determine the reference type.  */
 #define DF_REF_REG_DEF_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_DEF)
-#define DF_REF_REG_USE_P(REF) ((REF) && !DF_REF_REG_DEF_P (REF))
+#define DF_REF_REG_USE_P(REF) (!DF_REF_REG_DEF_P (REF))
 #define DF_REF_REG_MEM_STORE_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_MEM_STORE)
 #define DF_REF_REG_MEM_LOAD_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_MEM_LOAD)
 #define DF_REF_REG_MEM_P(REF) (DF_REF_REG_MEM_STORE_P (REF) \
                                || DF_REF_REG_MEM_LOAD_P (REF))
 
 #define DF_MWS_REG_DEF_P(MREF) (DF_MWS_TYPE (MREF) == DF_REF_REG_DEF)
-#define DF_MWS_REG_USE_P(MREF) ((MREF) && !DF_MWS_REG_DEF_P (MREF))
+#define DF_MWS_REG_USE_P(MREF) (!DF_MWS_REG_DEF_P (MREF))
 #define DF_MWS_TYPE(MREF) ((MREF)->type)
 
 /* Macros to get the refs out of def_info or use_info refs table.  If