Evaluation order of &&s in ||, in macro INDEX_TERM_P, in vax.h

John David Anglin dave@hiauly1.hia.nrc.ca
Mon Jun 12 08:18:00 GMT 2000


> The following patch to vax.h squashes a few warnings about &&s in ||,
> and might slightly improve the code generated by the INDEX_TERM_P macro.

Revised the patch to squelch signed/unsigned warnings from comparision.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-06-12  J. David Anglin  <dave@hiauly1.hia.nrc.ca>

	* vax.h (INDEX_TERM_P): Define evaluation order of &&'s in || and
	cast to squelch signed/unsigned warnings.

--- vax.h.orig	Fri May 26 13:10:48 2000
+++ vax.h	Mon Jun 12 11:10:46 2000
@@ -731,15 +731,15 @@
  : (GET_CODE (PROD) == MULT						\
     &&									\
     (xfoo0 = XEXP (PROD, 0), xfoo1 = XEXP (PROD, 1),			\
-     ((GET_CODE (xfoo0) == CONST_INT					\
-       && INTVAL (xfoo0) == GET_MODE_SIZE (MODE)			\
-       && GET_CODE (xfoo1) == REG					\
-       && REG_OK_FOR_INDEX_P (xfoo1))					\
-      ||								\
-      (GET_CODE (xfoo1) == CONST_INT					\
-       && INTVAL (xfoo1) == GET_MODE_SIZE (MODE)			\
-       && GET_CODE (xfoo0) == REG					\
-       && REG_OK_FOR_INDEX_P (xfoo0))))))
+     ((((GET_CODE (xfoo0) == CONST_INT					\
+         && GET_CODE (xfoo1) == REG)					\
+         && INTVAL (xfoo0) == (int)GET_MODE_SIZE (MODE))		\
+         && REG_OK_FOR_INDEX_P (xfoo1))					\
+        ||								\
+      (((GET_CODE (xfoo1) == CONST_INT					\
+         && GET_CODE (xfoo0) == REG)					\
+         && INTVAL (xfoo1) == (int)GET_MODE_SIZE (MODE))		\
+         && REG_OK_FOR_INDEX_P (xfoo0))))))
 
 /* Go to ADDR if X is the sum of a register
    and a valid index term for mode MODE.  */


More information about the Gcc-patches mailing list