]> granicus.if.org Git - apache/commitdiff
Merge r1470183 from trunk:
authorRuediger Pluem <rpluem@apache.org>
Fri, 26 Apr 2013 11:36:24 +0000 (11:36 +0000)
committerRuediger Pluem <rpluem@apache.org>
Fri, 26 Apr 2013 11:36:24 +0000 (11:36 +0000)
Add workaround for gcc bug on sparc/64bit

PR: 52900

Submitted by: sf
Reviewed by: sf, covener, rpluem

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1476144 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
server/core.c

diff --git a/CHANGES b/CHANGES
index 2aa3c5d168909df772d7e2505a40d1ec811b6cd6..eb15121cb06d41102833df039c9594401a24cb17 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
  
 Changes with Apache 2.4.5
 
+  *) core: Add workaround for gcc bug on sparc/64bit. PR 52900.
+     [Stefan Fritsch]
+
   *) mod_setenvif: Fix crash in case SetEnvif and SetEnvIfExpr are used
      together. PR 54881. [Ruediger Pluem]
 
diff --git a/STATUS b/STATUS
index ee36b9dace9bb8239b9a34191884a83646263ff9..2327d910c2e8fbdf4e042e7a8df9fe6ef330e4fd 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -95,11 +95,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
       2.4.x patch: trunk patches work
       +1: sf, humbedooh, covener
 
-    * core: Add workaround for gcc bug on sparc/64bit
-      trunk patches: https://svn.apache.org/r1470183
-      2.4.x patch: trunk patches work
-      +1: sf, covener, rpluem
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index 6f6d56868173ff4453ff7123b0da98f4474652e0..611b08fcbd631de70253e496acc4cc08f98a6b0d 100644 (file)
@@ -4768,13 +4768,18 @@ AP_DECLARE(void) ap_random_insecure_bytes(void *buf, apr_size_t size)
 AP_DECLARE(apr_uint32_t) ap_random_pick(apr_uint32_t min, apr_uint32_t max)
 {
     apr_uint32_t number;
+#if (!__GNUC__ || __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || \
+     !__sparc__ || APR_SIZEOF_VOIDP != 8)
+    /* This triggers a gcc bug on sparc/64bit with gcc < 4.8, PR 52900 */
     if (max < 16384) {
         apr_uint16_t num16;
         ap_random_insecure_bytes(&num16, sizeof(num16));
         RAND_RANGE(num16, min, max, APR_UINT16_MAX);
         number = num16;
     }
-    else {
+    else
+#endif
+    {
         ap_random_insecure_bytes(&number, sizeof(number));
         RAND_RANGE(number, min, max, APR_UINT32_MAX);
     }