bug 822717 - remove checks for old gcc r=glandium
authorTrevor Saunders <trev.saunders@gmail.com>
Tue, 18 Dec 2012 13:22:28 -0500
changeset 117173 4ebea4d88d4872cce65c9913492e8e2389e4e107
parent 117172 3c67ead5818a979052ba13503e66bced627f1f6e
child 117174 b99d9b422a3d581b1687066964fac3d4654f9a42
push id24087
push usergraememcc_firefox@graeme-online.co.uk
push dateSat, 29 Dec 2012 12:13:53 +0000
treeherdermozilla-central@b5ea211f23a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs822717
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 822717 - remove checks for old gcc r=glandium
dom/base/nsDOMClassInfoID.h
dom/plugins/ipc/PluginMessageUtils.h
js/src/jsdhash.h
js/src/jslibmath.h
js/src/jstypes.h
memory/mozalloc/mozalloc.cpp
mfbt/Assertions.h
mfbt/Attributes.h
mfbt/Likely.h
xpcom/base/nscore.h
xpcom/ds/nsMathUtils.h
xpcom/glue/arm.h
xpcom/glue/nsCOMPtr.h
xpcom/glue/pldhash.h
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
--- a/dom/base/nsDOMClassInfoID.h
+++ b/dom/base/nsDOMClassInfoID.h
@@ -88,18 +88,17 @@ class EventTarget;
 #undef DOMCI_CLASS
 
 /**
  * Provide a general "does class C implement interface I" predicate.
  * This is not as sophisticated as e.g. boost's is_base_of template,
  * but it does the job adequately for our purposes.
  */
 
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2) || \
-    _MSC_FULL_VER >= 140050215
+#if defined(__GNUC__) || _MSC_FULL_VER >= 140050215
 
 /* Use a compiler intrinsic if one is available. */
 
 #define DOMCI_CASTABLE_TO(_interface, _class) __is_base_of(_interface, _class)
 
 #else
 
 /* The generic version of this predicate relies on the overload resolution
--- a/dom/plugins/ipc/PluginMessageUtils.h
+++ b/dom/plugins/ipc/PluginMessageUtils.h
@@ -62,17 +62,17 @@ inline bool IsDrawingModelAsync(int16_t 
 #ifdef XP_WIN
          || aModel == NPDrawingModelAsyncWindowsDXGISurface
 #endif
          ;
 }
 
 #if defined(_MSC_VER)
 #define FULLFUNCTION __FUNCSIG__
-#elif (__GNUC__ >= 4)
+#elif defined(__GNUC__)
 #define FULLFUNCTION __PRETTY_FUNCTION__
 #else
 #define FULLFUNCTION __FUNCTION__
 #endif
 
 #define PLUGIN_LOG_DEBUG(args) PR_LOG(GetPluginLog(), PR_LOG_DEBUG, args)
 #define PLUGIN_LOG_DEBUG_FUNCTION PR_LOG(GetPluginLog(), PR_LOG_DEBUG, ("%s", FULLFUNCTION))
 #define PLUGIN_LOG_DEBUG_METHOD PR_LOG(GetPluginLog(), PR_LOG_DEBUG, ("%s [%p]", FULLFUNCTION, (void*) this))
--- a/js/src/jsdhash.h
+++ b/js/src/jsdhash.h
@@ -9,17 +9,17 @@
 /*
  * Double hashing, a la Knuth 6.
  *
  * Try to keep this file in sync with xpcom/glue/pldhash.h.
  */
 #include "jstypes.h"
 #include "jsutil.h"
 
-#if defined(__GNUC__) && defined(__i386__) && (__GNUC__ >= 3) && !defined(XP_OS2)
+#if defined(__GNUC__) && defined(__i386__) && !defined(XP_OS2)
 #define JS_DHASH_FASTCALL __attribute__ ((regparm (3),stdcall))
 #elif defined(XP_WIN)
 #define JS_DHASH_FASTCALL __fastcall
 #else
 #define JS_DHASH_FASTCALL
 #endif
 
 #ifdef DEBUG_XXXbrendan
--- a/js/src/jslibmath.h
+++ b/js/src/jslibmath.h
@@ -13,17 +13,17 @@
 #include <math.h>
 #include "jsnum.h"
 
 /*
  * Use system provided math routines.
  */
 
 /* The right copysign function is not always named the same thing. */
-#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#ifdef __GNUC__
 #define js_copysign __builtin_copysign
 #elif defined _WIN32
 #define js_copysign _copysign
 #else
 #define js_copysign copysign
 #endif
 
 #if defined(_M_X64) && defined(_MSC_VER) && _MSC_VER <= 1500
--- a/js/src/jstypes.h
+++ b/js/src/jstypes.h
@@ -69,18 +69,17 @@
 #  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA t
 #endif
 
 #define JS_FRIEND_API(t)    JS_PUBLIC_API(t)
 #define JS_FRIEND_DATA(t)   JS_PUBLIC_DATA(t)
 
 #if defined(_MSC_VER) && defined(_M_IX86)
 #define JS_FASTCALL __fastcall
-#elif defined(__GNUC__) && defined(__i386__) &&                         \
-  ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#elif defined(__GNUC__) && defined(__i386__)
 #define JS_FASTCALL __attribute__((fastcall))
 #else
 #define JS_FASTCALL
 #define JS_NO_FASTCALL
 #endif
 
 #ifndef JS_INLINE
 #define JS_INLINE MOZ_INLINE
@@ -204,17 +203,17 @@ typedef int JSBool;
 **          ... expected code path ...
 **      }
 **
 **      if (JS_UNLIKELY(v == 0)) {
 **          ... non-expected code path ...
 **      }
 **
 ***********************************************************************/
-#if defined(__GNUC__) && (__GNUC__ > 2)
+#ifdef __GNUC__
 
 # define JS_LIKELY(x)   (__builtin_expect((x), 1))
 # define JS_UNLIKELY(x) (__builtin_expect((x), 0))
 
 #else
 
 # define JS_LIKELY(x)   (x)
 # define JS_UNLIKELY(x) (x)
--- a/memory/mozalloc/mozalloc.cpp
+++ b/memory/mozalloc/mozalloc.cpp
@@ -29,17 +29,17 @@
 #include "mozilla/mozalloc.h"
 #include "mozilla/mozalloc_oom.h"  // for mozalloc_handle_oom
 
 /* Windows doesn't have malloc_usable_size, but jemalloc has */
 #if defined(MOZ_MEMORY_WINDOWS)
 extern "C" size_t malloc_usable_size(const void *ptr);
 #endif
 
-#if defined(__GNUC__) && (__GNUC__ > 2)
+#ifdef __GNUC__
 #define LIKELY(x)    (__builtin_expect(!!(x), 1))
 #define UNLIKELY(x)  (__builtin_expect(!!(x), 0))
 #else
 #define LIKELY(x)    (x)
 #define UNLIKELY(x)  (x)
 #endif
 
 void
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -56,18 +56,17 @@
 #  if defined(__clang__)
 #    ifndef __has_extension
 #      define __has_extension __has_feature /* compatibility, for older versions of clang */
 #    endif
 #    if __has_extension(cxx_static_assert)
 #      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  elif defined(__GNUC__)
-#    if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \
-        (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+#    if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
 #      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  elif defined(_MSC_VER)
 #    if _MSC_VER >= 1600 /* MSVC 10 */
 #      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  elif defined(__HP_aCC)
 #    if __HP_aCC >= 62500 && defined(_HP_CXX0x_SOURCE)
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -86,19 +86,17 @@
 #      define MOZ_HAVE_CXX11_DELETE
 #      define MOZ_HAVE_CXX11_OVERRIDE
 #      define MOZ_HAVE_CXX11_FINAL       final
 #    elif __GNUC__ == 4
 #      if __GNUC_MINOR__ >= 7
 #        define MOZ_HAVE_CXX11_OVERRIDE
 #        define MOZ_HAVE_CXX11_FINAL     final
 #      endif
-#      if __GNUC_MINOR__ >= 4
-#        define MOZ_HAVE_CXX11_DELETE
-#      endif
+#      define MOZ_HAVE_CXX11_DELETE
 #      if __GNUC_MINOR__ >= 5
 #        define MOZ_HAVE_CXX11_ENUM_TYPE
 #        define MOZ_HAVE_CXX11_STRONG_ENUMS
 #      endif
 #    endif
 #  else
      /* __final is a non-C++11 GCC synonym for 'final', per GCC r176655. */
 #    if __GNUC__ > 4
--- a/mfbt/Likely.h
+++ b/mfbt/Likely.h
@@ -6,17 +6,17 @@
 /*
  * MOZ_LIKELY and MOZ_UNLIKELY macros to hint to the compiler how a
  * boolean predicate should be branch-predicted.
  */
 
 #ifndef mozilla_Likely_h_
 #define mozilla_Likely_h_
 
-#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 2))
+#if defined(__clang__) || defined(__GNUC__)
 #  define MOZ_LIKELY(x)   (__builtin_expect(!!(x), 1))
 #  define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))
 #else
 #  define MOZ_LIKELY(x)   (!!(x))
 #  define MOZ_UNLIKELY(x) (!!(x))
 #endif
 
 #endif /* mozilla_Likely_h_ */
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -112,18 +112,17 @@ typedef size_t(*nsMallocSizeOfFun)(const
  *  - __fastcall on windows should not be applied to class
  *    constructors/destructors - use the NS_CONSTRUCTOR_FASTCALL macro for
  *    constructors/destructors.
  *
  * Examples: int NS_FASTCALL func1(char *foo);
  *           NS_HIDDEN_(int) NS_FASTCALL func2(char *foo);
  */
 
-#if defined(__i386__) && defined(__GNUC__) && \
-    (__GNUC__ >= 3) && !defined(XP_OS2)
+#if defined(__i386__) && defined(__GNUC__) && !defined(XP_OS2)
 #define NS_FASTCALL __attribute__ ((regparm (3), stdcall))
 #define NS_CONSTRUCTOR_FASTCALL __attribute__ ((regparm (3), stdcall))
 #elif defined(XP_WIN) && !defined(_WIN64)
 #define NS_FASTCALL __fastcall
 #define NS_CONSTRUCTOR_FASTCALL
 #else
 #define NS_FASTCALL
 #define NS_CONSTRUCTOR_FASTCALL
@@ -207,17 +206,17 @@ typedef size_t(*nsMallocSizeOfFun)(const
 #else
 #define NS_STDCALL_FUNCPROTO(ret, name, class, func, args) \
   ret (NS_STDCALL class::*name) args
 #endif
 
 /**
  * Deprecated declarations.
  */
-#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+#ifdef __GNUC__
 # define MOZ_DEPRECATED __attribute__((deprecated))
 #elif defined(_MSC_VER)
 # define MOZ_DEPRECATED __declspec(deprecated)
 #else
 # define MOZ_DEPRECATED
 #endif
 
 /**
--- a/xpcom/ds/nsMathUtils.h
+++ b/xpcom/ds/nsMathUtils.h
@@ -75,17 +75,17 @@ inline NS_HIDDEN_(int32_t) NS_lroundf(fl
 
 /*
  * hypot.  We don't need a super accurate version of this, if a platform
  * turns up with none of the possibilities below it would be okay to fall
  * back to sqrt(x*x + y*y).
  */
 inline NS_HIDDEN_(double) NS_hypot(double x, double y)
 {
-#if __GNUC__ >= 4
+#ifdef __GNUC__
     return __builtin_hypot(x, y);
 #elif defined _WIN32
     return _hypot(x, y);
 #else
     return hypot(x, y);
 #endif
 }
 
--- a/xpcom/glue/arm.h
+++ b/xpcom/glue/arm.h
@@ -48,38 +48,27 @@
 #  if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
    || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
    || defined(__ARM_ARCH_7EM__) || defined(_ARM_ARCH_7)
 #    undef MOZILLA_ARM_ARCH
 #    define MOZILLA_ARM_ARCH 7
 #  endif
 
 
-#  if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+#  ifdef __GNUC__
 #    define MOZILLA_MAY_SUPPORT_EDSP 1
-#  endif
 
-#  if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 #    if defined(HAVE_ARM_SIMD)
 #      define MOZILLA_MAY_SUPPORT_ARMV6 1
 #    endif
-#  endif
 
-  // Technically 4.2.x only works in the CodeSourcery releases, but I don't
-  // know how to detect those separately from mainline gcc (which got support
-  // in 4.3). The Maemo version 5 SDK shipped with the CodeSourcery 4.2.1
-  // release, which we need to work.
-#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
 #    if defined(HAVE_ARM_NEON)
 #      define MOZILLA_MAY_SUPPORT_NEON 1
 #    endif
-#  endif
 
-  // ARMv7 support was merged in gcc 4.3.
-#  if __GNUC__> 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
 #    if defined(HAVE_ARM_SIMD)
 #      define MOZILLA_MAY_SUPPORT_ARMV7 1
 #    endif
 #  endif
 
   // When using -mfpu=neon, gcc generates neon instructions.
 
 #  if defined(__ARM_NEON__)
--- a/xpcom/glue/nsCOMPtr.h
+++ b/xpcom/glue/nsCOMPtr.h
@@ -71,17 +71,17 @@
     problematic on a select few of our platforms, e.g., QNX.  Therefore, I'm providing
     a mechanism by which these features can be explicitly disabled from the command-line.
   */
 
 #ifdef NSCAP_DISABLE_TEST_DONTQUERY_CASES
   #undef NSCAP_FEATURE_TEST_DONTQUERY_CASES
 #endif
 
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+#ifdef __GNUC__
   // Our use of nsCOMPtr_base::mRawPtr violates the C++ standard's aliasing
   // rules. Mark it with the may_alias attribute so that gcc 3.3 and higher
   // don't reorder instructions based on aliasing assumptions for
   // this variable.  Fortunately, gcc versions < 3.3 do not do any
   // optimizations that break nsCOMPtr.
 
   #define NS_MAY_ALIAS_PTR(t)    t*  __attribute__((__may_alias__))
 #else
--- a/xpcom/glue/pldhash.h
+++ b/xpcom/glue/pldhash.h
@@ -12,17 +12,17 @@
  */
 #include "mozilla/Types.h"
 #include "nscore.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#if defined(__GNUC__) && defined(__i386__) && (__GNUC__ >= 3) && !defined(XP_OS2)
+#if defined(__GNUC__) && defined(__i386__) && !defined(XP_OS2)
 #define PL_DHASH_FASTCALL __attribute__ ((regparm (3),stdcall))
 #elif defined(XP_WIN)
 #define PL_DHASH_FASTCALL __fastcall
 #else
 #define PL_DHASH_FASTCALL
 #endif
 
 #ifdef DEBUG_XXXbrendan
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp
@@ -135,17 +135,17 @@ NS_InvokeByIndex(nsISupports* that, uint
  * Calling Standard]).
  *
  * !!! IMPORTANT !!!
  * This routine makes assumptions about the vtable layout of the c++ compiler. It's implemented
  * for arm-linux GNU g++ >= 2.8.1 (including egcs and gcc-2.95.[1-3])!
  *
  */
 
-#if (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 8))
+#ifdef __GNUC__
   __asm__ __volatile__(
     "ldr	r1, [%1, #12]	\n\t"	/* prepare to call invoke_count_words	*/
     "ldr	ip, [%1, #16]	\n\t"	/* r0=paramCount, r1=params		*/
     "ldr	r0, [%1,  #8]	\n\t"
     "mov	lr, pc		\n\t"	/* call it...				*/
     "mov	pc, ip		\n\t"
     "mov	r4, r0, lsl #2	\n\t"	/* This is the amount of bytes needed.	*/
     "sub	sp, sp, r4	\n\t"	/* use stack space for the args...	*/
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
@@ -7,17 +7,17 @@
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 
 #if !defined(__arm__) && !(defined(LINUX) || defined(ANDROID))
 #error "This code is for Linux ARM only. Please check if it works for you, too.\nDepends strongly on gcc behaviour."
 #endif
 
-#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+#ifdef __GNUC__
 /* This tells gcc3.4+ not to optimize away symbols.
  * @see http://gcc.gnu.org/gcc-3.4/changes.html
  */
 #define DONT_DROP_OR_WARN __attribute__((used))
 #else
 /* This tells older gccs not to warn about unused vairables.
  * @see http://docs.freebsd.org/info/gcc/gcc.info.Variable_Attributes.html
  */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Implement shared vtbl methods. */
 
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 
-#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+#ifdef __GNUC__
 /* This tells gcc3.4+ not to optimize away symbols.
  * @see http://gcc.gnu.org/gcc-3.4/changes.html
  */
 #define DONT_DROP_OR_WARN __attribute__((used))
 #else
 /* This tells older gccs not to warn about unused vairables.
  * @see http://docs.freebsd.org/info/gcc/gcc.info.Variable_Attributes.html
  */