Author: dgorbachev
Date: Sat Nov 2 14:33:18 2013
New Revision: 60833
URL:
http://svn.reactos.org/svn/reactos?rev=60833&view=rev
Log:
Remove some stuff added for old GCC versions.
Modified:
trunk/reactos/cmake/config.cmake
trunk/reactos/cmake/gcc.cmake
trunk/reactos/include/crt/mingw32/intrin.h
trunk/reactos/include/crt/mingw32/intrin_ppc.h
trunk/reactos/lib/rtl/srw.c
trunk/reactos/ntoskrnl/ex/handle.c
trunk/reactos/ntoskrnl/ex/pushlock.c
trunk/reactos/ntoskrnl/fsrtl/fastio.c
trunk/reactos/ntoskrnl/include/internal/ex.h
trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h
Modified: trunk/reactos/cmake/config.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/config.cmake?rev=608…
==============================================================================
--- trunk/reactos/cmake/config.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/config.cmake [iso-8859-1] Sat Nov 2 14:33:18 2013
@@ -78,4 +78,4 @@
endif()
set(USE_DUMMY_PSEH FALSE CACHE BOOL
-"Whether to disable PSEH support.")
+"Whether to disable PSEH support.")
Modified: trunk/reactos/cmake/gcc.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/gcc.cmake?rev=60833&…
==============================================================================
--- trunk/reactos/cmake/gcc.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/gcc.cmake [iso-8859-1] Sat Nov 2 14:33:18 2013
@@ -61,14 +61,10 @@
add_compile_flags("-march=${OARCH}")
endif()
-# Warnings
-add_compile_flags("-Werror -Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar
-Wno-unused-value")
-
-if(GCC_VERSION VERSION_LESS 4.7)
- add_compile_flags("-Wno-error=uninitialized")
-elseif(GCC_VERSION VERSION_EQUAL 4.7 OR GCC_VERSION VERSION_GREATER 4.7)
- add_compile_flags("-Wno-error=unused-but-set-variable -Wno-maybe-uninitialized
-Wno-error=narrowing")
-endif()
+# Warnings, errors
+add_compile_flags("-Werror -Wall -Wpointer-arith")
+add_compile_flags("-Wno-char-subscripts -Wno-multichar -Wno-unused-value
-Wno-maybe-uninitialized")
+add_compile_flags("-Wno-error=unused-but-set-variable -Wno-error=narrowing")
if(ARCH STREQUAL "amd64")
add_compile_flags("-Wno-format")
@@ -82,7 +78,7 @@
elseif(OPTIMIZE STREQUAL "2")
add_compile_flags("-Os")
elseif(OPTIMIZE STREQUAL "3")
- add_compile_flags("-O1 -fno-inline-functions-called-once -fno-tree-sra")
+ add_compile_flags("-Og")
elseif(OPTIMIZE STREQUAL "4")
add_compile_flags("-O1")
elseif(OPTIMIZE STREQUAL "5")
Modified: trunk/reactos/include/crt/mingw32/intrin.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
==============================================================================
--- trunk/reactos/include/crt/mingw32/intrin.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/mingw32/intrin.h [iso-8859-1] Sat Nov 2 14:33:18 2013
@@ -113,7 +113,7 @@
/* BUGBUG: only good for use in macros. Cannot be taken the address of */
#define __noop(...) ((void)0)
-/* TODO: __assume. GCC only supports the weaker __builtin_expect */
+#define __assume(x) if (!(x)) __builtin_unreachable()
#endif
Modified: trunk/reactos/include/crt/mingw32/intrin_ppc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin…
==============================================================================
--- trunk/reactos/include/crt/mingw32/intrin_ppc.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/mingw32/intrin_ppc.h [iso-8859-1] Sat Nov 2 14:33:18 2013
@@ -785,7 +785,7 @@
/* BUGBUG: only good for use in macros. Cannot be taken the address of */
#define __noop(...) ((void)0)
-/* TODO: __assume. GCC only supports the weaker __builtin_expect */
+#define __assume(x) if (!(x)) __builtin_unreachable()
#endif
/* EOF */
Modified: trunk/reactos/lib/rtl/srw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/srw.c?rev=60833&am…
==============================================================================
--- trunk/reactos/lib/rtl/srw.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/srw.c [iso-8859-1] Sat Nov 2 14:33:18 2013
@@ -44,16 +44,6 @@
RTL_SRWLOCK_SHARED | RTL_SRWLOCK_CONTENTION_LOCK)
#define RTL_SRWLOCK_BITS 4
-#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40300) || \
- (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ == 40303)
-/* This macro will cause the code to assert if compiled with a buggy
- version of GCC that doesn't align the wait blocks properly on the stack! */
-#define ASSERT_SRW_WAITBLOCK(ptr) \
- ASSERT(((ULONG_PTR)ptr & ((1 << RTL_SRWLOCK_BITS) - 1)) == 0)
-#else
-#define ASSERT_SRW_WAITBLOCK(ptr) ((void)0)
-#endif
-
typedef struct _RTLP_SRWLOCK_SHARED_WAKE
{
LONG Wake;
@@ -231,7 +221,6 @@
WaitBlock = (PRTLP_SRWLOCK_WAITBLOCK)(PrevValue & ~RTL_SRWLOCK_MASK);
- ASSERT_SRW_WAITBLOCK(WaitBlock);
return WaitBlock;
}
@@ -395,8 +384,6 @@
Shared->LastSharedWake = &SharedWake;
- ASSERT_SRW_WAITBLOCK(Shared);
-
RtlpReleaseWaitBlockLock(SRWLock);
RtlpAcquireSRWLockSharedWait(SRWLock,
@@ -467,8 +454,6 @@
Shared->LastSharedWake->Next = &SharedWake;
}
- ASSERT_SRW_WAITBLOCK(Shared);
-
Shared->SharedCount++;
Shared->LastSharedWake = &SharedWake;
@@ -496,8 +481,6 @@
StackWaitBlock.SharedWakeChain = &SharedWake;
StackWaitBlock.LastSharedWake = &SharedWake;
- ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
-
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_OWNED |
RTL_SRWLOCK_CONTENDED;
if
((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
(PVOID)NewValue,
@@ -635,8 +618,6 @@
StackWaitBlock.Last = &StackWaitBlock;
StackWaitBlock.Wake = 0;
- ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
-
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_SHARED |
RTL_SRWLOCK_CONTENDED | RTL_SRWLOCK_OWNED;
if
((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
@@ -665,8 +646,6 @@
StackWaitBlock.Next = NULL;
StackWaitBlock.Last = &StackWaitBlock;
StackWaitBlock.Wake = 0;
-
- ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
First = RtlpAcquireWaitBlockLock(SRWLock);
if (First != NULL)
@@ -694,8 +673,6 @@
StackWaitBlock.Last = &StackWaitBlock;
StackWaitBlock.Wake = 0;
- ASSERT_SRW_WAITBLOCK(&StackWaitBlock);
-
NewValue = (ULONG_PTR)&StackWaitBlock | RTL_SRWLOCK_OWNED |
RTL_SRWLOCK_CONTENDED;
if
((LONG_PTR)InterlockedCompareExchangePointer(&SRWLock->Ptr,
(PVOID)NewValue,
Modified: trunk/reactos/ntoskrnl/ex/handle.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=6…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] Sat Nov 2 14:33:18 2013
@@ -845,23 +845,23 @@
IN PHANDLE_TABLE_ENTRY HandleTableEntry)
{
LONG_PTR OldValue;
- DEFINE_WAIT_BLOCK(WaitBlock);
+ EX_PUSH_LOCK_WAIT_BLOCK WaitBlock;
/* Block on the pushlock */
- ExBlockPushLock(&HandleTable->HandleContentionEvent, WaitBlock);
+ ExBlockPushLock(&HandleTable->HandleContentionEvent, &WaitBlock);
/* Get the current value and check if it's been unlocked */
OldValue = HandleTableEntry->Value;
if (!(OldValue) || (OldValue & EXHANDLE_TABLE_ENTRY_LOCK_BIT))
{
/* Unblock the pushlock and return */
- ExfUnblockPushLock(&HandleTable->HandleContentionEvent, WaitBlock);
+ ExfUnblockPushLock(&HandleTable->HandleContentionEvent, &WaitBlock);
}
else
{
/* Wait for it to be unblocked */
ExWaitForUnblockPushLock(&HandleTable->HandleContentionEvent,
- WaitBlock);
+ &WaitBlock);
}
}
Modified: trunk/reactos/ntoskrnl/ex/pushlock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/pushlock.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/pushlock.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/pushlock.c [iso-8859-1] Sat Nov 2 14:33:18 2013
@@ -472,7 +472,8 @@
{
EX_PUSH_LOCK OldValue = *PushLock, NewValue, TempValue;
BOOLEAN NeedWake;
- DEFINE_WAIT_BLOCK(WaitBlock);
+ EX_PUSH_LOCK_WAIT_BLOCK Block;
+ PEX_PUSH_LOCK_WAIT_BLOCK WaitBlock = &Block;
/* Start main loop */
for (;;)
@@ -645,7 +646,8 @@
{
EX_PUSH_LOCK OldValue = *PushLock, NewValue;
BOOLEAN NeedWake;
- DEFINE_WAIT_BLOCK(WaitBlock);
+ EX_PUSH_LOCK_WAIT_BLOCK Block;
+ PEX_PUSH_LOCK_WAIT_BLOCK WaitBlock = &Block;
/* Start main loop */
for (;;)
Modified: trunk/reactos/ntoskrnl/fsrtl/fastio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/fastio.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/fsrtl/fastio.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/fsrtl/fastio.c [iso-8859-1] Sat Nov 2 14:33:18 2013
@@ -294,11 +294,6 @@
ASSERT(FileObject);
ASSERT(FileObject->FsContext);
-
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ == 405)
- /* Silence incorrect GCC 4.5.x warning */
- OldFileSize.LowPart = 0;
-#endif
/* Initialize some of the vars and pointers */
NewSize.QuadPart = 0;
@@ -546,11 +541,6 @@
else
{
LARGE_INTEGER OldFileSize;
-
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ == 405)
- /* Silence incorrect GCC 4.5.x warning */
- OldFileSize.QuadPart = 0;
-#endif
/* Sanity check */
ASSERT(!KeIsExecutingDpc());
Modified: trunk/reactos/ntoskrnl/include/internal/ex.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ex.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/ex.h [iso-8859-1] Sat Nov 2 14:33:18 2013
@@ -98,34 +98,6 @@
#define MAX_MID_INDEX (MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES)
#define MAX_HIGH_INDEX (MID_LEVEL_ENTRIES * MID_LEVEL_ENTRIES * LOW_LEVEL_ENTRIES)
-//
-// Detect old GCC
-//
-#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40300) || \
- (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ == 40303)
-
-#define DEFINE_WAIT_BLOCK(x) \
- struct _AlignHack \
- { \
- UCHAR Hack[15]; \
- EX_PUSH_LOCK_WAIT_BLOCK UnalignedBlock; \
- } WaitBlockBuffer; \
- PEX_PUSH_LOCK_WAIT_BLOCK x = (PEX_PUSH_LOCK_WAIT_BLOCK) \
- ((ULONG_PTR)&WaitBlockBuffer.UnalignedBlock &~ 0xF);
-
-#else
-
-//
-// This is only for compatibility; the compiler will optimize the extra
-// local variable (the actual pointer) away, so we don't take any perf hit
-// by doing this.
-//
-#define DEFINE_WAIT_BLOCK(x) \
- EX_PUSH_LOCK_WAIT_BLOCK WaitBlockBuffer; \
- PEX_PUSH_LOCK_WAIT_BLOCK x = &WaitBlockBuffer;
-
-#endif
-
#define ExpChangeRundown(x, y, z)
(ULONG_PTR)InterlockedCompareExchangePointer(&x->Ptr, (PVOID)y, (PVOID)z)
#define ExpChangePushlock(x, y, z) InterlockedCompareExchangePointer((PVOID*)x, (PVOID)y,
(PVOID)z)
#define ExpSetRundown(x, y) InterlockedExchangePointer(&x->Ptr, (PVOID)y)
Modified: trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] Sat Nov 2 14:33:18
2013
@@ -10,20 +10,10 @@
#define TRAP_DEBUG 0
-//
-// Unreachable code hint for GCC 4.5.x, older GCC versions, and MSVC
-//
-#ifdef __GNUC__
-#if __GNUC__ * 100 + __GNUC_MINOR__ >= 405
-#define UNREACHABLE __builtin_unreachable()
-#else
-#define UNREACHABLE __builtin_trap()
-#endif
-#elif _MSC_VER
#define UNREACHABLE __assume(0)
+
+#if _MSC_VER
#define __builtin_expect(a,b) (a)
-#else
-#define UNREACHABLE
#endif
//