diff mbox

Another MIPS fix for -Werror=undef

Message ID 446fbedd-fc76-4cdf-9222-18b0ccb430b0@BAMAIL02.ba.imgtec.org
State New
Headers show

Commit Message

Steve Ellcey Feb. 17, 2015, 7:13 p.m. UTC
I ran into another MIPS build problem related to -Werror=undef.  This one
only affects R6 builds (__mips_isa_rev > 5).  In that case memcpy and memset
will check if 'PREFETCH_STORE_HINT == PREFETCH_HINT_PREPAREFORSTORE' before
PREFETCH_HINT_PREPAREFORSTORE is defined.

This patch fixes the build by moving the check down later in the file after
PREFETCH_HINT_PREPAREFORSTORE is set.

Tested with mips-img-linux-gnu.  OK to checkin?

Steve Ellcey
sellcey@imgtec.com



2015-02-17  Steve Ellcey  <sellcey@imgtec.com>

	* sysdeps/mips/memcpy.S: Move R6 PREFETCH_STORE_HINT check.
	* sysdeps/mips/memset.S: Ditto.

Comments

Joseph Myers Feb. 17, 2015, 9:16 p.m. UTC | #1
On Tue, 17 Feb 2015, Steve Ellcey  wrote:

> I ran into another MIPS build problem related to -Werror=undef.  This one
> only affects R6 builds (__mips_isa_rev > 5).  In that case memcpy and memset
> will check if 'PREFETCH_STORE_HINT == PREFETCH_HINT_PREPAREFORSTORE' before
> PREFETCH_HINT_PREPAREFORSTORE is defined.
> 
> This patch fixes the build by moving the check down later in the file after
> PREFETCH_HINT_PREPAREFORSTORE is set.
> 
> Tested with mips-img-linux-gnu.  OK to checkin?

OK.
diff mbox

Patch

diff --git a/sysdeps/mips/memcpy.S b/sysdeps/mips/memcpy.S
index a9ac059..c85935b 100644
--- a/sysdeps/mips/memcpy.S
+++ b/sysdeps/mips/memcpy.S
@@ -50,15 +50,6 @@ 
 # endif
 #endif
 
-
-#if __mips_isa_rev > 5
-# if (PREFETCH_STORE_HINT == PREFETCH_HINT_PREPAREFORSTORE)
-#  undef PREFETCH_STORE_HINT
-#  define PREFETCH_STORE_HINT PREFETCH_HINT_STORE_STREAMED
-# endif
-# define R6_CODE
-#endif
-
 /* Some asm.h files do not have the L macro definition.  */
 #ifndef L
 # if _MIPS_SIM == _ABIO32
@@ -196,6 +187,14 @@ 
 # define PREFETCH_FOR_STORE(offset, reg)
 #endif
 
+#if __mips_isa_rev > 5
+# if (PREFETCH_STORE_HINT == PREFETCH_HINT_PREPAREFORSTORE)
+#  undef PREFETCH_STORE_HINT
+#  define PREFETCH_STORE_HINT PREFETCH_HINT_STORE_STREAMED
+# endif
+# define R6_CODE
+#endif
+
 /* Allow the routine to be named something else if desired.  */
 #ifndef MEMCPY_NAME
 # define MEMCPY_NAME memcpy
diff --git a/sysdeps/mips/memset.S b/sysdeps/mips/memset.S
index cf16b26..864ab07 100644
--- a/sysdeps/mips/memset.S
+++ b/sysdeps/mips/memset.S
@@ -54,13 +54,6 @@ 
 # endif
 #endif
 
-#if __mips_isa_rev > 5
-# if (PREFETCH_STORE_HINT == PREFETCH_HINT_PREPAREFORSTORE)
-#  undef PREFETCH_STORE_HINT
-#  define PREFETCH_STORE_HINT PREFETCH_HINT_STORE_STREAMED
-# endif
-# define R6_CODE
-#endif
 
 /* Some asm.h files do not have the L macro definition.  */
 #ifndef L
@@ -159,6 +152,14 @@ 
 # define PREFETCH_FOR_STORE(offset, reg)
 #endif
 
+#if __mips_isa_rev > 5
+# if (PREFETCH_STORE_HINT == PREFETCH_HINT_PREPAREFORSTORE)
+#  undef PREFETCH_STORE_HINT
+#  define PREFETCH_STORE_HINT PREFETCH_HINT_STORE_STREAMED
+# endif
+# define R6_CODE
+#endif
+
 /* Allow the routine to be named something else if desired.  */
 #ifndef MEMSET_NAME
 # define MEMSET_NAME memset