4.8.0-0.15

This commit is contained in:
Jakub Jelinek 2013-03-04 13:47:31 +01:00
parent 8799d226ba
commit 2bea4b26c1
10 changed files with 176 additions and 1095 deletions

1
.gitignore vendored
View File

@ -63,3 +63,4 @@
/gcc-4.8.0-20130213.tar.bz2 /gcc-4.8.0-20130213.tar.bz2
/gcc-4.8.0-20130215.tar.bz2 /gcc-4.8.0-20130215.tar.bz2
/gcc-4.8.0-20130220.tar.bz2 /gcc-4.8.0-20130220.tar.bz2
/gcc-4.8.0-20130304.tar.bz2

View File

@ -1,9 +1,9 @@
%global DATE 20130220 %global DATE 20130304
%global SVNREV 196173 %global SVNREV 196430
%global gcc_version 4.8.0 %global gcc_version 4.8.0
# Note, gcc_release must be integer, if you want to add suffixes to # Note, gcc_release must be integer, if you want to add suffixes to
# %{release}, append them after %{gcc_release} on Release: line. # %{release}, append them after %{gcc_release} on Release: line.
%global gcc_release 0.14 %global gcc_release 0.15
%global _unpackaged_files_terminate_build 0 %global _unpackaged_files_terminate_build 0
%global multilib_64_archs sparc64 ppc64 s390x x86_64 %global multilib_64_archs sparc64 ppc64 s390x x86_64
%ifarch %{ix86} x86_64 ia64 ppc ppc64 alpha %ifarch %{ix86} x86_64 ia64 ppc ppc64 alpha
@ -194,11 +194,8 @@ Patch10: gcc48-pr38757.patch
Patch11: gcc48-libstdc++-docs.patch Patch11: gcc48-libstdc++-docs.patch
Patch12: gcc48-no-add-needed.patch Patch12: gcc48-no-add-needed.patch
Patch13: gcc48-pr55608.patch Patch13: gcc48-pr55608.patch
Patch14: gcc48-asan-speedup.patch Patch14: gcc48-pr56424.patch
Patch15: gcc48-pr56258.patch Patch15: gcc48-pr56509.patch
Patch16: gcc48-pr56405.patch
Patch17: gcc48-unused-locals.patch
Patch18: gcc48-pr56265.patch
Patch1000: fastjar-0.97-segfault.patch Patch1000: fastjar-0.97-segfault.patch
Patch1001: fastjar-0.97-len1.patch Patch1001: fastjar-0.97-len1.patch
@ -751,11 +748,8 @@ package or when debugging this package.
%endif %endif
%patch12 -p0 -b .no-add-needed~ %patch12 -p0 -b .no-add-needed~
%patch13 -p0 -b .pr55608~ %patch13 -p0 -b .pr55608~
%patch14 -p0 -b .asan-speedup~ %patch14 -p0 -b .pr56424~
%patch15 -p0 -b .pr56258~ %patch15 -p0 -b .pr56509~
%patch16 -p0 -b .pr56405~
%patch17 -p0 -b .unused-locals~
%patch18 -p0 -b .pr56265~
%if 0%{?_enable_debug_packages} %if 0%{?_enable_debug_packages}
cat > split-debuginfo.sh <<\EOF cat > split-debuginfo.sh <<\EOF
@ -2979,6 +2973,24 @@ fi
%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/plugin %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/plugin
%changelog %changelog
* Mon Mar 4 2013 Jakub Jelinek <jakub@redhat.com> 4.8.0-0.15
- updated from trunk
- PRs c++/10291, c++/40405, c++/52688, c++/55632, c++/55813, c++/56243,
c++/56358, c++/56359, c++/56377, c++/56395, c++/56403, c++/56419,
c++/56438, c++/56481, fortran/54730, fortran/56385, fortran/56416,
fortran/56477, fortran/56491, libfortran/30162, libstdc++/56011,
libstdc++/56012, middle-end/45472, middle-end/56077,
middle-end/56108, middle-end/56420, middle-end/56461,
rtl-optimization/50339, rtl-optimization/56466, sanitizer/56393,
sanitizer/56454, target/48901, target/52500, target/52501,
target/52550, target/54639, target/54640, target/54662, target/56444,
target/56445, target/56455, testsuite/52641, tree-optimization/55481,
tree-optimization/56175, tree-optimization/56294,
tree-optimization/56310, tree-optimization/56415,
tree-optimization/56426, tree-optimization/56443,
tree-optimization/56448
- fnsplit fix (PR tree-optimization/56424)
* Wed Feb 20 2013 Jakub Jelinek <jakub@redhat.com> 4.8.0-0.14 * Wed Feb 20 2013 Jakub Jelinek <jakub@redhat.com> 4.8.0-0.14
- updated from trunk - updated from trunk
- PRs asan/56330, c++/51242, c++/54276, c++/56373, libquadmath/56379, - PRs asan/56330, c++/51242, c++/54276, c++/56373, libquadmath/56379,

View File

@ -1,535 +0,0 @@
2013-02-15 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.c: Use 0x7fff8000 as asan_shadow_offset on x86_64
linux.
* All source files: Merge from upstream.
--- gcc/config/i386/i386.c.jj 2013-02-13 17:04:34.000000000 +0100
+++ gcc/config/i386/i386.c 2013-02-15 13:27:47.674832994 +0100
@@ -5436,7 +5436,8 @@ ix86_legitimate_combined_insn (rtx insn)
static unsigned HOST_WIDE_INT
ix86_asan_shadow_offset (void)
{
- return TARGET_LP64 ? (HOST_WIDE_INT_1 << 44)
+ return TARGET_LP64 ? (TARGET_MACHO ? (HOST_WIDE_INT_1 << 44)
+ : HOST_WIDE_INT_C (0x7fff8000))
: (HOST_WIDE_INT_1 << 29);
}
--- libsanitizer/sanitizer_common/sanitizer_internal_defs.h.jj 2013-02-13 11:53:43.403336342 +0100
+++ libsanitizer/sanitizer_common/sanitizer_internal_defs.h 2013-02-15 13:24:17.410033137 +0100
@@ -29,7 +29,7 @@
# define SANITIZER_SUPPORTS_WEAK_HOOKS 0
#endif
-// __has_feature
+// GCC does not understand __has_feature
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
--- libsanitizer/sanitizer_common/sanitizer_linux.cc.jj 2013-02-13 11:53:43.402336347 +0100
+++ libsanitizer/sanitizer_common/sanitizer_linux.cc 2013-02-15 13:24:17.410033137 +0100
@@ -232,6 +232,21 @@ const char *GetEnv(const char *name) {
return 0; // Not found.
}
+#ifdef __GLIBC__
+
+extern "C" {
+ extern void *__libc_stack_end;
+}
+
+static void GetArgsAndEnv(char ***argv, char ***envp) {
+ uptr *stack_end = (uptr *)__libc_stack_end;
+ int argc = *stack_end;
+ *argv = (char**)(stack_end + 1);
+ *envp = (char**)(stack_end + argc + 2);
+}
+
+#else // __GLIBC__
+
static void ReadNullSepFileToArray(const char *path, char ***arr,
int arr_size) {
char *buff;
@@ -251,11 +266,17 @@ static void ReadNullSepFileToArray(const
(*arr)[count] = 0;
}
+static void GetArgsAndEnv(char ***argv, char ***envp) {
+ static const int kMaxArgv = 2000, kMaxEnvp = 2000;
+ ReadNullSepFileToArray("/proc/self/cmdline", argv, kMaxArgv);
+ ReadNullSepFileToArray("/proc/self/environ", envp, kMaxEnvp);
+}
+
+#endif // __GLIBC__
+
void ReExec() {
- static const int kMaxArgv = 100, kMaxEnvp = 1000;
char **argv, **envp;
- ReadNullSepFileToArray("/proc/self/cmdline", &argv, kMaxArgv);
- ReadNullSepFileToArray("/proc/self/environ", &envp, kMaxEnvp);
+ GetArgsAndEnv(&argv, &envp);
execve(argv[0], argv, envp);
}
--- libsanitizer/asan/asan_internal.h.jj 2013-02-13 11:53:44.377330938 +0100
+++ libsanitizer/asan/asan_internal.h 2013-02-15 13:24:17.412033319 +0100
@@ -52,7 +52,7 @@
#define ASAN_POSIX (ASAN_LINUX || ASAN_MAC)
-#if __has_feature(address_sanitizer)
+#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
# error "The AddressSanitizer run-time should not be"
" instrumented by AddressSanitizer"
#endif
--- libsanitizer/asan/asan_mac.cc.jj 2013-02-13 11:53:44.397330832 +0100
+++ libsanitizer/asan/asan_mac.cc 2013-02-15 13:24:17.412033319 +0100
@@ -104,7 +104,24 @@ void MaybeReexec() {
_NSGetExecutablePath(program_name, &buf_size);
// Ok to use setenv() since the wrappers don't depend on the value of
// asan_inited.
- setenv(kDyldInsertLibraries, info.dli_fname, /*overwrite*/0);
+ if (dyld_insert_libraries) {
+ // Append the runtime dylib name to the existing value of
+ // DYLD_INSERT_LIBRARIES.
+ uptr old_env_len = internal_strlen(dyld_insert_libraries);
+ uptr fname_len = internal_strlen(info.dli_fname);
+ LowLevelAllocator allocator_for_env;
+ char *new_env =
+ (char*)allocator_for_env.Allocate(old_env_len + fname_len + 2);
+ internal_strncpy(new_env, dyld_insert_libraries, old_env_len);
+ new_env[old_env_len] = ':';
+ // Copy fname_len and add a trailing zero.
+ internal_strncpy(new_env + old_env_len + 1, info.dli_fname,
+ fname_len + 1);
+ setenv(kDyldInsertLibraries, new_env, /*overwrite*/1);
+ } else {
+ // Set DYLD_INSERT_LIBRARIES equal to the runtime dylib name.
+ setenv(kDyldInsertLibraries, info.dli_fname, /*overwrite*/0);
+ }
if (flags()->verbosity >= 1) {
Report("exec()-ing the program with\n");
Report("%s=%s\n", kDyldInsertLibraries, info.dli_fname);
--- libsanitizer/asan/asan_mapping.h.jj 2013-02-13 17:04:34.680198753 +0100
+++ libsanitizer/asan/asan_mapping.h 2013-02-15 13:26:25.846301749 +0100
@@ -1,7 +1,5 @@
//===-- asan_mapping.h ------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
@@ -18,6 +16,37 @@
// The full explanation of the memory mapping could be found here:
// http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerAlgorithm
+//
+// Typical shadow mapping on Linux/x86_64 with SHADOW_OFFSET == 0x00007fff8000:
+// || `[0x10007fff8000, 0x7fffffffffff]` || HighMem ||
+// || `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||
+// || `[0x00008fff7000, 0x02008fff6fff]` || ShadowGap ||
+// || `[0x00007fff8000, 0x00008fff6fff]` || LowShadow ||
+// || `[0x000000000000, 0x00007fff7fff]` || LowMem ||
+//
+// When SHADOW_OFFSET is zero (-pie):
+// || `[0x100000000000, 0x7fffffffffff]` || HighMem ||
+// || `[0x020000000000, 0x0fffffffffff]` || HighShadow ||
+// || `[0x000000040000, 0x01ffffffffff]` || ShadowGap ||
+//
+// Special case when something is already mapped between
+// 0x003000000000 and 0x004000000000 (e.g. when prelink is installed):
+// || `[0x10007fff8000, 0x7fffffffffff]` || HighMem ||
+// || `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||
+// || `[0x004000000000, 0x02008fff6fff]` || ShadowGap3 ||
+// || `[0x003000000000, 0x003fffffffff]` || MidMem ||
+// || `[0x00087fff8000, 0x002fffffffff]` || ShadowGap2 ||
+// || `[0x00067fff8000, 0x00087fff7fff]` || MidShadow ||
+// || `[0x00008fff7000, 0x00067fff7fff]` || ShadowGap ||
+// || `[0x00007fff8000, 0x00008fff6fff]` || LowShadow ||
+// || `[0x000000000000, 0x00007fff7fff]` || LowMem ||
+//
+// Default Linux/i386 mapping:
+// || `[0x40000000, 0xffffffff]` || HighMem ||
+// || `[0x28000000, 0x3fffffff]` || HighShadow ||
+// || `[0x24000000, 0x27ffffff]` || ShadowGap ||
+// || `[0x20000000, 0x23ffffff]` || LowShadow ||
+// || `[0x00000000, 0x1fffffff]` || LowMem ||
#if ASAN_FLEXIBLE_MAPPING_AND_OFFSET == 1
extern SANITIZER_INTERFACE_ATTRIBUTE uptr __asan_mapping_scale;
@@ -36,7 +65,11 @@ extern SANITIZER_INTERFACE_ATTRIBUTE upt
# if defined(__powerpc64__)
# define SHADOW_OFFSET (1ULL << 41)
# else
-# define SHADOW_OFFSET (1ULL << 44)
+# if ASAN_MAC
+# define SHADOW_OFFSET (1ULL << 44)
+# else
+# define SHADOW_OFFSET 0x7fff8000ULL
+# endif
# endif
# endif
# endif
@@ -57,49 +90,105 @@ extern SANITIZER_INTERFACE_ATTRIBUTE upt
#define kHighShadowBeg MEM_TO_SHADOW(kHighMemBeg)
#define kHighShadowEnd MEM_TO_SHADOW(kHighMemEnd)
+# define kMidShadowBeg MEM_TO_SHADOW(kMidMemBeg)
+# define kMidShadowEnd MEM_TO_SHADOW(kMidMemEnd)
+
// With the zero shadow base we can not actually map pages starting from 0.
// This constant is somewhat arbitrary.
#define kZeroBaseShadowStart (1 << 18)
#define kShadowGapBeg (kLowShadowEnd ? kLowShadowEnd + 1 \
: kZeroBaseShadowStart)
-#define kShadowGapEnd (kHighShadowBeg - 1)
+#define kShadowGapEnd ((kMidMemBeg ? kMidShadowBeg : kHighShadowBeg) - 1)
+
+#define kShadowGap2Beg (kMidMemBeg ? kMidShadowEnd + 1 : 0)
+#define kShadowGap2End (kMidMemBeg ? kMidMemBeg - 1 : 0)
+
+#define kShadowGap3Beg (kMidMemBeg ? kMidMemEnd + 1 : 0)
+#define kShadowGap3End (kMidMemBeg ? kHighShadowBeg - 1 : 0)
+
+#define DO_ASAN_MAPPING_PROFILE 0 // Set to 1 to profile the functions below.
+
+#if DO_ASAN_MAPPING_PROFILE
+# define PROFILE_ASAN_MAPPING() AsanMappingProfile[__LINE__]++;
+#else
+# define PROFILE_ASAN_MAPPING()
+#endif
+
+// If 1, all shadow boundaries are constants.
+// Don't set to 1 other than for testing.
+#define ASAN_FIXED_MAPPING 0
namespace __asan {
+extern uptr AsanMappingProfile[];
+
+#if ASAN_FIXED_MAPPING
+// Fixed mapping for 64-bit Linux. Mostly used for performance comparison
+// with non-fixed mapping. As of r175253 (Feb 2013) the performance
+// difference between fixed and non-fixed mapping is below the noise level.
+static uptr kHighMemEnd = 0x7fffffffffffULL;
+static uptr kMidMemBeg = 0x3000000000ULL;
+static uptr kMidMemEnd = 0x3fffffffffULL;
+#else
SANITIZER_INTERFACE_ATTRIBUTE
-extern uptr kHighMemEnd; // Initialized in __asan_init.
+extern uptr kHighMemEnd, kMidMemBeg, kMidMemEnd; // Initialized in __asan_init.
+#endif
static inline bool AddrIsInLowMem(uptr a) {
+ PROFILE_ASAN_MAPPING();
return a < kLowMemEnd;
}
static inline bool AddrIsInLowShadow(uptr a) {
+ PROFILE_ASAN_MAPPING();
return a >= kLowShadowBeg && a <= kLowShadowEnd;
}
static inline bool AddrIsInHighMem(uptr a) {
+ PROFILE_ASAN_MAPPING();
return a >= kHighMemBeg && a <= kHighMemEnd;
}
+static inline bool AddrIsInMidMem(uptr a) {
+ PROFILE_ASAN_MAPPING();
+ return kMidMemBeg && a >= kMidMemBeg && a <= kMidMemEnd;
+}
+
static inline bool AddrIsInMem(uptr a) {
- return AddrIsInLowMem(a) || AddrIsInHighMem(a);
+ PROFILE_ASAN_MAPPING();
+ return AddrIsInLowMem(a) || AddrIsInMidMem(a) || AddrIsInHighMem(a);
}
static inline uptr MemToShadow(uptr p) {
+ PROFILE_ASAN_MAPPING();
CHECK(AddrIsInMem(p));
return MEM_TO_SHADOW(p);
}
static inline bool AddrIsInHighShadow(uptr a) {
- return a >= kHighShadowBeg && a <= kHighMemEnd;
+ PROFILE_ASAN_MAPPING();
+ return a >= kHighShadowBeg && a <= kHighMemEnd;
+}
+
+static inline bool AddrIsInMidShadow(uptr a) {
+ PROFILE_ASAN_MAPPING();
+ return kMidMemBeg && a >= kMidShadowBeg && a <= kMidMemEnd;
}
static inline bool AddrIsInShadow(uptr a) {
- return AddrIsInLowShadow(a) || AddrIsInHighShadow(a);
+ PROFILE_ASAN_MAPPING();
+ return AddrIsInLowShadow(a) || AddrIsInMidShadow(a) || AddrIsInHighShadow(a);
}
static inline bool AddrIsInShadowGap(uptr a) {
+ PROFILE_ASAN_MAPPING();
+ if (kMidMemBeg) {
+ if (a <= kShadowGapEnd)
+ return SHADOW_OFFSET == 0 || a >= kShadowGapBeg;
+ return (a >= kShadowGap2Beg && a <= kShadowGap2End) ||
+ (a >= kShadowGap3Beg && a <= kShadowGap3End);
+ }
// In zero-based shadow mode we treat addresses near zero as addresses
// in shadow gap as well.
if (SHADOW_OFFSET == 0)
@@ -108,10 +197,12 @@ static inline bool AddrIsInShadowGap(upt
}
static inline bool AddrIsAlignedByGranularity(uptr a) {
+ PROFILE_ASAN_MAPPING();
return (a & (SHADOW_GRANULARITY - 1)) == 0;
}
static inline bool AddressIsPoisoned(uptr a) {
+ PROFILE_ASAN_MAPPING();
const uptr kAccessSize = 1;
u8 *shadow_address = (u8*)MemToShadow(a);
s8 shadow_value = *shadow_address;
@@ -123,6 +214,9 @@ static inline bool AddressIsPoisoned(upt
return false;
}
+// Must be after all calls to PROFILE_ASAN_MAPPING().
+static const uptr kAsanMappingProfileSize = __LINE__;
+
} // namespace __asan
#endif // ASAN_MAPPING_H
--- libsanitizer/asan/asan_rtl.cc.jj 2013-02-13 17:04:25.688240113 +0100
+++ libsanitizer/asan/asan_rtl.cc 2013-02-15 13:24:17.411033229 +0100
@@ -25,6 +25,8 @@
namespace __asan {
+uptr AsanMappingProfile[kAsanMappingProfileSize];
+
static void AsanDie() {
static atomic_uint32_t num_calls;
if (atomic_fetch_add(&num_calls, 1, memory_order_relaxed) != 0) {
@@ -35,8 +37,14 @@ static void AsanDie() {
Report("Sleeping for %d second(s)\n", flags()->sleep_before_dying);
SleepForSeconds(flags()->sleep_before_dying);
}
- if (flags()->unmap_shadow_on_exit)
- UnmapOrDie((void*)kLowShadowBeg, kHighShadowEnd - kLowShadowBeg);
+ if (flags()->unmap_shadow_on_exit) {
+ if (kMidMemBeg) {
+ UnmapOrDie((void*)kLowShadowBeg, kMidMemBeg - kLowShadowBeg);
+ UnmapOrDie((void*)kMidMemEnd, kHighShadowEnd - kMidMemEnd);
+ } else {
+ UnmapOrDie((void*)kLowShadowBeg, kHighShadowEnd - kLowShadowBeg);
+ }
+ }
if (death_callback)
death_callback();
if (flags()->abort_on_error)
@@ -161,7 +169,10 @@ void InitializeFlags(Flags *f, const cha
int asan_inited;
bool asan_init_is_running;
void (*death_callback)(void);
-uptr kHighMemEnd;
+
+#if !ASAN_FIXED_MAPPING
+uptr kHighMemEnd, kMidMemBeg, kMidMemEnd;
+#endif
// -------------------------- Misc ---------------- {{{1
void ShowStatsAndAbort() {
@@ -259,9 +270,15 @@ static NOINLINE void force_interface_sym
static void asan_atexit() {
Printf("AddressSanitizer exit stats:\n");
__asan_print_accumulated_stats();
+ // Print AsanMappingProfile.
+ for (uptr i = 0; i < kAsanMappingProfileSize; i++) {
+ if (AsanMappingProfile[i] == 0) continue;
+ Printf("asan_mapping.h:%zd -- %zd\n", i, AsanMappingProfile[i]);
+ }
}
static void InitializeHighMemEnd() {
+#if !ASAN_FIXED_MAPPING
#if SANITIZER_WORDSIZE == 64
# if defined(__powerpc64__)
// FIXME:
@@ -277,6 +294,58 @@ static void InitializeHighMemEnd() {
#else // SANITIZER_WORDSIZE == 32
kHighMemEnd = (1ULL << 32) - 1; // 0xffffffff;
#endif // SANITIZER_WORDSIZE
+#endif // !ASAN_FIXED_MAPPING
+}
+
+static void ProtectGap(uptr a, uptr size) {
+ CHECK_EQ(a, (uptr)Mprotect(a, size));
+}
+
+static void PrintAddressSpaceLayout() {
+ Printf("|| `[%p, %p]` || HighMem ||\n",
+ (void*)kHighMemBeg, (void*)kHighMemEnd);
+ Printf("|| `[%p, %p]` || HighShadow ||\n",
+ (void*)kHighShadowBeg, (void*)kHighShadowEnd);
+ if (kMidMemBeg) {
+ Printf("|| `[%p, %p]` || ShadowGap3 ||\n",
+ (void*)kShadowGap3Beg, (void*)kShadowGap3End);
+ Printf("|| `[%p, %p]` || MidMem ||\n",
+ (void*)kMidMemBeg, (void*)kMidMemEnd);
+ Printf("|| `[%p, %p]` || ShadowGap2 ||\n",
+ (void*)kShadowGap2Beg, (void*)kShadowGap2End);
+ Printf("|| `[%p, %p]` || MidShadow ||\n",
+ (void*)kMidShadowBeg, (void*)kMidShadowEnd);
+ }
+ Printf("|| `[%p, %p]` || ShadowGap ||\n",
+ (void*)kShadowGapBeg, (void*)kShadowGapEnd);
+ if (kLowShadowBeg) {
+ Printf("|| `[%p, %p]` || LowShadow ||\n",
+ (void*)kLowShadowBeg, (void*)kLowShadowEnd);
+ Printf("|| `[%p, %p]` || LowMem ||\n",
+ (void*)kLowMemBeg, (void*)kLowMemEnd);
+ }
+ Printf("MemToShadow(shadow): %p %p %p %p",
+ (void*)MEM_TO_SHADOW(kLowShadowBeg),
+ (void*)MEM_TO_SHADOW(kLowShadowEnd),
+ (void*)MEM_TO_SHADOW(kHighShadowBeg),
+ (void*)MEM_TO_SHADOW(kHighShadowEnd));
+ if (kMidMemBeg) {
+ Printf(" %p %p",
+ (void*)MEM_TO_SHADOW(kMidShadowBeg),
+ (void*)MEM_TO_SHADOW(kMidShadowEnd));
+ }
+ Printf("\n");
+ Printf("red_zone=%zu\n", (uptr)flags()->redzone);
+ Printf("malloc_context_size=%zu\n", (uptr)flags()->malloc_context_size);
+
+ Printf("SHADOW_SCALE: %zx\n", (uptr)SHADOW_SCALE);
+ Printf("SHADOW_GRANULARITY: %zx\n", (uptr)SHADOW_GRANULARITY);
+ Printf("SHADOW_OFFSET: %zx\n", (uptr)SHADOW_OFFSET);
+ CHECK(SHADOW_SCALE >= 3 && SHADOW_SCALE <= 7);
+ if (kMidMemBeg)
+ CHECK(kMidShadowBeg > kLowShadowEnd &&
+ kMidMemBeg > kMidShadowEnd &&
+ kHighShadowBeg > kMidMemEnd);
}
} // namespace __asan
@@ -352,49 +421,48 @@ void __asan_init() {
ReplaceSystemMalloc();
ReplaceOperatorsNewAndDelete();
- if (flags()->verbosity) {
- Printf("|| `[%p, %p]` || HighMem ||\n",
- (void*)kHighMemBeg, (void*)kHighMemEnd);
- Printf("|| `[%p, %p]` || HighShadow ||\n",
- (void*)kHighShadowBeg, (void*)kHighShadowEnd);
- Printf("|| `[%p, %p]` || ShadowGap ||\n",
- (void*)kShadowGapBeg, (void*)kShadowGapEnd);
- Printf("|| `[%p, %p]` || LowShadow ||\n",
- (void*)kLowShadowBeg, (void*)kLowShadowEnd);
- Printf("|| `[%p, %p]` || LowMem ||\n",
- (void*)kLowMemBeg, (void*)kLowMemEnd);
- Printf("MemToShadow(shadow): %p %p %p %p\n",
- (void*)MEM_TO_SHADOW(kLowShadowBeg),
- (void*)MEM_TO_SHADOW(kLowShadowEnd),
- (void*)MEM_TO_SHADOW(kHighShadowBeg),
- (void*)MEM_TO_SHADOW(kHighShadowEnd));
- Printf("red_zone=%zu\n", (uptr)flags()->redzone);
- Printf("malloc_context_size=%zu\n", (uptr)flags()->malloc_context_size);
-
- Printf("SHADOW_SCALE: %zx\n", (uptr)SHADOW_SCALE);
- Printf("SHADOW_GRANULARITY: %zx\n", (uptr)SHADOW_GRANULARITY);
- Printf("SHADOW_OFFSET: %zx\n", (uptr)SHADOW_OFFSET);
- CHECK(SHADOW_SCALE >= 3 && SHADOW_SCALE <= 7);
+ uptr shadow_start = kLowShadowBeg;
+ if (kLowShadowBeg) shadow_start -= GetMmapGranularity();
+ uptr shadow_end = kHighShadowEnd;
+ bool full_shadow_is_available =
+ MemoryRangeIsAvailable(shadow_start, shadow_end);
+
+#if ASAN_LINUX && defined(__x86_64__) && !ASAN_FIXED_MAPPING
+ if (!full_shadow_is_available) {
+ kMidMemBeg = kLowMemEnd < 0x3000000000ULL ? 0x3000000000ULL : 0;
+ kMidMemEnd = kLowMemEnd < 0x3000000000ULL ? 0x3fffffffffULL : 0;
}
+#endif
+
+ if (flags()->verbosity)
+ PrintAddressSpaceLayout();
if (flags()->disable_core) {
DisableCoreDumper();
}
- uptr shadow_start = kLowShadowBeg;
- if (kLowShadowBeg > 0) shadow_start -= GetMmapGranularity();
- uptr shadow_end = kHighShadowEnd;
- if (MemoryRangeIsAvailable(shadow_start, shadow_end)) {
- if (kLowShadowBeg != kLowShadowEnd) {
- // mmap the low shadow plus at least one page.
- ReserveShadowMemoryRange(kLowShadowBeg - GetMmapGranularity(),
- kLowShadowEnd);
- }
+ if (full_shadow_is_available) {
+ // mmap the low shadow plus at least one page at the left.
+ if (kLowShadowBeg)
+ ReserveShadowMemoryRange(shadow_start, kLowShadowEnd);
+ // mmap the high shadow.
+ ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd);
+ // protect the gap.
+ ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1);
+ } else if (kMidMemBeg &&
+ MemoryRangeIsAvailable(shadow_start, kMidMemBeg - 1) &&
+ MemoryRangeIsAvailable(kMidMemEnd + 1, shadow_end)) {
+ CHECK(kLowShadowBeg != kLowShadowEnd);
+ // mmap the low shadow plus at least one page at the left.
+ ReserveShadowMemoryRange(shadow_start, kLowShadowEnd);
+ // mmap the mid shadow.
+ ReserveShadowMemoryRange(kMidShadowBeg, kMidShadowEnd);
// mmap the high shadow.
ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd);
- // protect the gap
- void *prot = Mprotect(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1);
- CHECK(prot == (void*)kShadowGapBeg);
+ // protect the gaps.
+ ProtectGap(kShadowGapBeg, kShadowGapEnd - kShadowGapBeg + 1);
+ ProtectGap(kShadowGap2Beg, kShadowGap2End - kShadowGap2Beg + 1);
+ ProtectGap(kShadowGap3Beg, kShadowGap3End - kShadowGap3Beg + 1);
} else {
Report("Shadow memory range interleaves with an existing memory mapping. "
"ASan cannot proceed correctly. ABORTING.\n");
--- libsanitizer/include/sanitizer/common_interface_defs.h.jj 2013-02-13 11:53:44.531330044 +0100
+++ libsanitizer/include/sanitizer/common_interface_defs.h 2013-02-15 13:24:17.403032450 +0100
@@ -14,6 +14,11 @@
#include <stddef.h>
#include <stdint.h>
+// GCC does not understand __has_feature.
+#if !defined(__has_feature)
+# define __has_feature(x) 0
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
--- libsanitizer/include/sanitizer/asan_interface.h.jj 2013-02-13 11:53:44.531330044 +0100
+++ libsanitizer/include/sanitizer/asan_interface.h 2013-02-15 13:24:17.403032450 +0100
@@ -35,8 +35,8 @@ extern "C" {
// (un)poison memory in the same memory region simultaneously.
void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
- // User code should use macro instead of functions.
-#if __has_feature(address_sanitizer)
+// User code should use macros instead of functions.
+#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
#define ASAN_POISON_MEMORY_REGION(addr, size) \
__asan_poison_memory_region((addr), (size))
#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \

View File

@ -1,81 +0,0 @@
2013-02-20 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/56258
* doc/invoke.texi (-fdump-rtl-pro_and_epilogue): Use @item
instead of @itemx.
* gnat-style.texi (@title): Remove @hfill.
* projects.texi: Avoid line wrapping inside of @pxref or
@xref.
* doc/cp-tools.texinfo (Virtual Machine Options): Use just
one @gccoptlist instead of 3 separate ones.
--- gcc/doc/invoke.texi.jj 2013-01-31 22:57:22.000000000 +0100
+++ gcc/doc/invoke.texi 2013-02-20 13:06:47.516405739 +0100
@@ -5612,7 +5612,7 @@ Dump after the peephole pass.
@opindex fdump-rtl-postreload
Dump after post-reload optimizations.
-@itemx -fdump-rtl-pro_and_epilogue
+@item -fdump-rtl-pro_and_epilogue
@opindex fdump-rtl-pro_and_epilogue
Dump after generating the function prologues and epilogues.
--- gcc/ada/gnat-style.texi.jj 2012-08-10 12:57:33.000000000 +0200
+++ gcc/ada/gnat-style.texi 2013-02-20 13:06:03.042667300 +0100
@@ -42,7 +42,7 @@ Texts. A copy of the license is include
@titlepage
@titlefont{GNAT Coding Style:}
@sp 1
-@title @hfill A Guide for GNAT Developers
+@title A Guide for GNAT Developers
@subtitle GNAT, The GNU Ada Compiler
@versionsubtitle
@author Ada Core Technologies, Inc.
--- gcc/ada/projects.texi.jj 2013-01-04 11:16:24.000000000 +0100
+++ gcc/ada/projects.texi 2013-02-20 17:48:41.582645159 +0100
@@ -48,8 +48,7 @@ project files allow you to specify:
@item Source file naming conventions; you can specify these either globally or for
individual compilation units (@pxref{Naming Schemes}).
@item Change any of the above settings depending on external values, thus enabling
- the reuse of the projects in various @b{scenarios} (@pxref{Scenarios
- in Projects}).
+ the reuse of the projects in various @b{scenarios} (@pxref{Scenarios in Projects}).
@item Automatically build libraries as part of the build process
(@pxref{Library Projects}).
@@ -360,8 +359,8 @@ locating the specified source files in t
@item For various reasons, it is sometimes useful to have a project with no
sources (most of the time because the attributes defined in the project
- file will be reused in other projects, as explained in @pxref{Organizing
- Projects into Subsystems}. To do this, the attribute
+ file will be reused in other projects, as explained in
+ @pxref{Organizing Projects into Subsystems}. To do this, the attribute
@emph{Source_Files} is set to the empty list, i.e. @code{()}. Alternatively,
@emph{Source_Dirs} can be set to the empty list, with the same
result.
@@ -388,8 +387,9 @@ locating the specified source files in t
This can be done thanks to the attribute @b{Excluded_Source_Files}
(or its synonym @b{Locally_Removed_Files}).
Its value is the list of file names that should not be taken into account.
- This attribute is often used when extending a project, @xref{Project
- Extension}. A similar attribute @b{Excluded_Source_List_File} plays the same
+ This attribute is often used when extending a project,
+ @xref{Project Extension}. A similar attribute
+ @b{Excluded_Source_List_File} plays the same
role but takes the name of file containing file names similarly to
@code{Source_List_File}.
--- libjava/classpath/doc/cp-tools.texinfo.jj 2012-12-20 11:38:51.000000000 +0100
+++ libjava/classpath/doc/cp-tools.texinfo 2013-02-20 19:10:42.573925165 +0100
@@ -2025,7 +2025,7 @@ Doclet, grouped by type. Explanations a
@item Virtual Machine Options
@xref{Virtual Machine Options,,Options Controlling Gjdoc Behavior}.
-@gccoptlist{-classpath} @gccoptlist{-bootclasspath} @gccoptlist{-J}@var{vmopt}
+@gccoptlist{-classpath -bootclasspath -J @var{vmopt}}
@end table

View File

@ -1,132 +0,0 @@
2013-02-20 Jan Hubicka <jh@suse.cz>
PR tree-optimization/56265
* ipa-prop.c (ipa_make_edge_direct_to_target): Fixup callgraph when target is
referenced for firs ttime.
* testsuite/g++.dg/ipa/devirt-11.C: New testcase.
--- gcc/ipa-prop.c (revision 196176)
+++ gcc/ipa-prop.c (revision 196177)
@@ -2100,10 +2100,65 @@ ipa_make_edge_direct_to_target (struct c
if (TREE_CODE (target) == ADDR_EXPR)
target = TREE_OPERAND (target, 0);
if (TREE_CODE (target) != FUNCTION_DECL)
- return NULL;
+ {
+ target = canonicalize_constructor_val (target, NULL);
+ if (!target || TREE_CODE (target) != FUNCTION_DECL)
+ {
+ if (dump_file)
+ fprintf (dump_file, "ipa-prop: Discovered direct call to non-function"
+ " in (%s/%i).\n",
+ cgraph_node_name (ie->caller), ie->caller->uid);
+ return NULL;
+ }
+ }
callee = cgraph_get_node (target);
- if (!callee)
- return NULL;
+
+ /* Because may-edges are not explicitely represented and vtable may be external,
+ we may create the first reference to the object in the unit. */
+ if (!callee || callee->global.inlined_to)
+ {
+ struct cgraph_node *first_clone = callee;
+
+ /* We are better to ensure we can refer to it.
+ In the case of static functions we are out of luck, since we already
+ removed its body. In the case of public functions we may or may
+ not introduce the reference. */
+ if (!canonicalize_constructor_val (target, NULL)
+ || !TREE_PUBLIC (target))
+ {
+ if (dump_file)
+ fprintf (dump_file, "ipa-prop: Discovered call to a known target "
+ "(%s/%i -> %s/%i) but can not refer to it. Giving up.\n",
+ xstrdup (cgraph_node_name (ie->caller)), ie->caller->uid,
+ xstrdup (cgraph_node_name (ie->callee)), ie->callee->uid);
+ return NULL;
+ }
+
+ /* Create symbol table node. Even if inline clone exists, we can not take
+ it as a target of non-inlined call. */
+ callee = cgraph_create_node (target);
+
+ /* OK, we previously inlined the function, then removed the offline copy and
+ now we want it back for external call. This can happen when devirtualizing
+ while inlining function called once that happens after extern inlined and
+ virtuals are already removed. In this case introduce the external node
+ and make it available for call. */
+ if (first_clone)
+ {
+ first_clone->clone_of = callee;
+ callee->clones = first_clone;
+ symtab_prevail_in_asm_name_hash ((symtab_node)callee);
+ symtab_insert_node_to_hashtable ((symtab_node)callee);
+ if (dump_file)
+ fprintf (dump_file, "ipa-prop: Introduced new external node "
+ "(%s/%i) and turned into root of the clone tree.\n",
+ xstrdup (cgraph_node_name (callee)), callee->uid);
+ }
+ else if (dump_file)
+ fprintf (dump_file, "ipa-prop: Introduced new external node "
+ "(%s/%i).\n",
+ xstrdup (cgraph_node_name (callee)), callee->uid);
+ }
ipa_check_create_node_params ();
/* We can not make edges to inline clones. It is bug that someone removed
--- gcc/testsuite/g++.dg/ipa/devirt-11.C (revision 0)
+++ gcc/testsuite/g++.dg/ipa/devirt-11.C (revision 196177)
@@ -0,0 +1,50 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-inline" } */
+int baz ();
+struct A
+{
+ virtual int fn2 () = 0;
+ virtual int *fn3 ();
+ double *fn4 ();
+ int fn5 (int);
+ template <class T>
+ void fn1 (A &, T) { fn3 (); fn4 (); fn2 (); }
+};
+struct B : A
+{
+ int fn2 () { return 6; }
+ void fn3 (int, double);
+ B (bool = true);
+ B (int, int);
+};
+template <typename T>
+void
+foo (B &x, A &y, A &z)
+{
+ y.fn2 ();
+ z.fn2 ();
+ int i = baz ();
+ int j = (y.fn3 ())[i];
+ x.fn3 (j, (y.fn4 ())[i] + (z.fn4 ())[z.fn5 (j)]);
+}
+inline B
+operator+ (A &y, A &z)
+{
+ B x;
+ foo<int> (x, y, z);
+ return x;
+}
+void
+bar ()
+{
+ B a, b, c (4, 0), d;
+ a.fn1 (b, .6);
+ baz ();
+ c + d;
+}
+/* While inlining function called once we should devirtualize a new call to fn2
+ and two to fn3. While doing so the new symbol for fn2 needs to be
+ introduced. */
+/* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target" 3 "inline" } } */
+/* { dg-final { scan-ipa-dump-times "and turned into root of the clone tree" 1 "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */

View File

@ -1,36 +0,0 @@
2013-02-20 Jakub Jelinek <jakub@redhat.com>
PR inline-asm/56405
* expr.c (expand_expr_real_1) <case TARGET_MEM_REF, MEM_REF>: Don't
use movmisalign or extract_bit_field for EXPAND_MEMORY modifier.
* gcc.c-torture/compile/pr56405.c: New test.
--- gcc/expr.c.jj 2013-01-18 18:09:40.000000000 +0100
+++ gcc/expr.c 2013-02-20 10:29:34.513143634 +0100
@@ -9551,6 +9551,7 @@ expand_expr_real_1 (tree exp, rtx target
set_mem_addr_space (temp, as);
align = get_object_alignment (exp);
if (modifier != EXPAND_WRITE
+ && modifier != EXPAND_MEMORY
&& mode != BLKmode
&& align < GET_MODE_ALIGNMENT (mode)
/* If the target does not have special handling for unaligned
@@ -9639,6 +9640,7 @@ expand_expr_real_1 (tree exp, rtx target
if (TREE_THIS_VOLATILE (exp))
MEM_VOLATILE_P (temp) = 1;
if (modifier != EXPAND_WRITE
+ && modifier != EXPAND_MEMORY
&& mode != BLKmode
&& align < GET_MODE_ALIGNMENT (mode))
{
--- gcc/testsuite/gcc.c-torture/compile/pr56405.c.jj 2013-02-20 10:32:17.807250979 +0100
+++ gcc/testsuite/gcc.c-torture/compile/pr56405.c 2013-02-20 10:32:46.963090873 +0100
@@ -0,0 +1,7 @@
+/* PR inline-asm/56405 */
+
+void
+foo (void)
+{
+ asm volatile ("" : "+m" (*(volatile unsigned short *) 0x1001UL));
+}

57
gcc48-pr56424.patch Normal file
View File

@ -0,0 +1,57 @@
2013-03-04 Eric Botcazou <ebotcazou@adacore.com>
PR tree-optimization/56424
* ipa-split.c (split_function): Do not set the RSO flag if result is
not by reference and its type is not a register type.
* gcc.dg/pr56424.c: New test.
--- gcc/ipa-split.c (revision 196253)
+++ gcc/ipa-split.c (working copy)
@@ -1309,7 +1309,9 @@ split_function (struct split_point *spli
so return slot optimization is always possible. Moreover this is
required to make DECL_BY_REFERENCE work. */
if (aggregate_value_p (DECL_RESULT (current_function_decl),
- TREE_TYPE (current_function_decl)))
+ TREE_TYPE (current_function_decl))
+ && (!is_gimple_reg_type (TREE_TYPE (DECL_RESULT (current_function_decl)))
+ || DECL_BY_REFERENCE (DECL_RESULT (current_function_decl))))
gimple_call_set_return_slot_opt (call, true);
/* Update return value. This is bit tricky. When we do not return,
--- gcc/testsuite/gcc.dg/pr56424.c 2013-02-13 21:50:57.150673158 +0100
+++ gcc/testsuite/gcc.dg/pr56424.c 2013-03-04 12:59:24.133888683 +0100
@@ -0,0 +1,33 @@
+/* PR tree-optimization/56424 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fexceptions -fnon-call-exceptions" } */
+
+extern long double cosl (long double);
+extern long double sinl (long double);
+extern long double reml (long double, long double);
+
+long double my_cos (long double arg)
+{
+ return cosl (arg);
+}
+
+long double my_sin (long double arg)
+{
+ if (__builtin_fabs (arg) < 1.0)
+ return arg;
+
+ return sinl (arg);
+}
+
+long double my_cot (long double arg, long double cycle)
+{
+ long double t = reml (arg, cycle);
+ return my_cos (t) / my_sin (t);
+}
+
+long double my_tan (long double arg, long double cycle)
+{
+ long double t = reml (arg, cycle);
+ return my_sin (t) / my_cos (t);
+}

92
gcc48-pr56509.patch Normal file
View File

@ -0,0 +1,92 @@
2013-03-04 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/56509
* opts.c (opts_obstack, opts_concat): Moved to...
* opts-common.c (opts_obstack, opts_concat): ... here.
--- gcc/opts-common.c.jj 2013-02-27 08:27:26.000000000 +0100
+++ gcc/opts-common.c 2013-03-04 10:02:58.016096542 +0100
@@ -692,6 +692,40 @@ decode_cmdline_option (const char **argv
return result;
}
+/* Obstack for option strings. */
+
+struct obstack opts_obstack;
+
+/* Like libiberty concat, but allocate using opts_obstack. */
+
+char *
+opts_concat (const char *first, ...)
+{
+ char *newstr, *end;
+ size_t length = 0;
+ const char *arg;
+ va_list ap;
+
+ /* First compute the size of the result and get sufficient memory. */
+ va_start (ap, first);
+ for (arg = first; arg; arg = va_arg (ap, const char *))
+ length += strlen (arg);
+ newstr = XOBNEWVEC (&opts_obstack, char, length + 1);
+ va_end (ap);
+
+ /* Now copy the individual pieces to the result string. */
+ va_start (ap, first);
+ for (arg = first, end = newstr; arg; arg = va_arg (ap, const char *))
+ {
+ length = strlen (arg);
+ memcpy (end, arg, length);
+ end += length;
+ }
+ *end = '\0';
+ va_end (ap);
+ return newstr;
+}
+
/* Decode command-line options (ARGC and ARGV being the arguments of
main) into an array, setting *DECODED_OPTIONS to a pointer to that
array and *DECODED_OPTIONS_COUNT to the number of entries in the
--- gcc/opts.c.jj 2013-02-27 08:27:26.000000000 +0100
+++ gcc/opts.c 2013-03-04 10:02:16.401346992 +0100
@@ -268,40 +268,6 @@ add_comma_separated_to_vector (void **pv
*pvec = v;
}
-/* Like libiberty concat, but allocate using opts_obstack. */
-
-char *
-opts_concat (const char *first, ...)
-{
- char *newstr, *end;
- size_t length = 0;
- const char *arg;
- va_list ap;
-
- /* First compute the size of the result and get sufficient memory. */
- va_start (ap, first);
- for (arg = first; arg; arg = va_arg (ap, const char *))
- length += strlen (arg);
- newstr = XOBNEWVEC (&opts_obstack, char, length + 1);
- va_end (ap);
-
- /* Now copy the individual pieces to the result string. */
- va_start (ap, first);
- for (arg = first, end = newstr; arg; arg = va_arg (ap, const char *))
- {
- length = strlen (arg);
- memcpy (end, arg, length);
- end += length;
- }
- *end = '\0';
- va_end (ap);
- return newstr;
-}
-
-/* Obstack for option strings. */
-
-struct obstack opts_obstack;
-
/* Initialize OPTS and OPTS_SET before using them in parsing options. */
void

View File

@ -1,297 +0,0 @@
2013-02-20 Richard Biener <rguenther@suse.de>
* tree-call-cdce.c (tree_call_cdce): Do not remove unused locals.
* tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise.
* tree-ssa-dce.c (perform_tree_ssa_dce): Likewise.
* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Do
not return anything.
(rename_ssa_copies): Do not remove unused locals.
* tree-ssa-ccp.c (do_ssa_ccp): Likewise.
* tree-ssanames.c (pass_release_ssa_names): Remove unused
locals first.
* passes.c (execute_function_todo): Do not schedule unused locals
removal if cleanup_tree_cfg did something.
* tree-ssa-live.c (remove_unused_locals): Dump statistics
about the number of removed locals.
* gcc.dg/tree-ssa/forwprop-8.c: Adjust.
--- gcc/tree-ssa-copyrename.c (revision 196173)
+++ gcc/tree-ssa-copyrename.c (revision 196174)
@@ -113,7 +113,7 @@ static struct
/* Coalesce the partitions in MAP representing VAR1 and VAR2 if it is valid.
Choose a representative for the partition, and send debug info to DEBUG. */
-static bool
+static void
copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
{
int p1, p2, p3;
@@ -146,7 +146,7 @@ copy_rename_partition_coalesce (var_map
{
if (debug)
fprintf (debug, " : Already coalesced.\n");
- return false;
+ return;
}
rep1 = partition_to_var (map, p1);
@@ -154,7 +154,7 @@ copy_rename_partition_coalesce (var_map
root1 = SSA_NAME_VAR (rep1);
root2 = SSA_NAME_VAR (rep2);
if (!root1 && !root2)
- return false;
+ return;
/* Don't coalesce if one of the variables occurs in an abnormal PHI. */
abnorm = (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rep1)
@@ -163,7 +163,7 @@ copy_rename_partition_coalesce (var_map
{
if (debug)
fprintf (debug, " : Abnormal PHI barrier. No coalesce.\n");
- return false;
+ return;
}
/* Partitions already have the same root, simply merge them. */
@@ -172,7 +172,7 @@ copy_rename_partition_coalesce (var_map
p1 = partition_union (map->var_partition, p1, p2);
if (debug)
fprintf (debug, " : Same root, coalesced --> P%d.\n", p1);
- return false;
+ return;
}
/* Never attempt to coalesce 2 different parameters. */
@@ -181,7 +181,7 @@ copy_rename_partition_coalesce (var_map
{
if (debug)
fprintf (debug, " : 2 different PARM_DECLS. No coalesce.\n");
- return false;
+ return;
}
if ((root1 && TREE_CODE (root1) == RESULT_DECL)
@@ -189,7 +189,7 @@ copy_rename_partition_coalesce (var_map
{
if (debug)
fprintf (debug, " : One root a RESULT_DECL. No coalesce.\n");
- return false;
+ return;
}
ign1 = !root1 || (TREE_CODE (root1) == VAR_DECL && DECL_IGNORED_P (root1));
@@ -206,7 +206,7 @@ copy_rename_partition_coalesce (var_map
{
if (debug)
fprintf (debug, " : 2 different USER vars. No coalesce.\n");
- return false;
+ return;
}
else
ign2 = true;
@@ -220,7 +220,7 @@ copy_rename_partition_coalesce (var_map
{
if (debug)
fprintf (debug, " : 2 default defs. No coalesce.\n");
- return false;
+ return;
}
else
{
@@ -240,7 +240,7 @@ copy_rename_partition_coalesce (var_map
{
if (debug)
fprintf (debug, " : Choosen variable has no root. No coalesce.\n");
- return false;
+ return;
}
/* Don't coalesce if the new chosen root variable would be read-only.
@@ -253,7 +253,7 @@ copy_rename_partition_coalesce (var_map
{
if (debug)
fprintf (debug, " : Readonly variable. No coalesce.\n");
- return false;
+ return;
}
/* Don't coalesce if the two variables aren't type compatible . */
@@ -266,7 +266,7 @@ copy_rename_partition_coalesce (var_map
{
if (debug)
fprintf (debug, " : Incompatible types. No coalesce.\n");
- return false;
+ return;
}
/* Merge the two partitions. */
@@ -288,7 +288,6 @@ copy_rename_partition_coalesce (var_map
TDF_SLIM);
fprintf (debug, "\n");
}
- return true;
}
@@ -308,7 +307,6 @@ rename_ssa_copies (void)
gimple stmt, phi;
unsigned x;
FILE *debug;
- bool updated = false;
memset (&stats, 0, sizeof (stats));
@@ -330,7 +328,7 @@ rename_ssa_copies (void)
tree lhs = gimple_assign_lhs (stmt);
tree rhs = gimple_assign_rhs1 (stmt);
- updated |= copy_rename_partition_coalesce (map, lhs, rhs, debug);
+ copy_rename_partition_coalesce (map, lhs, rhs, debug);
}
}
}
@@ -358,8 +356,8 @@ rename_ssa_copies (void)
{
tree arg = PHI_ARG_DEF (phi, i);
if (TREE_CODE (arg) == SSA_NAME)
- updated |= copy_rename_partition_coalesce (map, res, arg,
- debug);
+ copy_rename_partition_coalesce (map, res, arg,
+ debug);
}
/* Else if all arguments are in the same partition try to merge
it with the result. */
@@ -390,9 +388,9 @@ rename_ssa_copies (void)
}
}
if (all_p_same == 1)
- updated |= copy_rename_partition_coalesce (map, res,
- PHI_ARG_DEF (phi, 0),
- debug);
+ copy_rename_partition_coalesce (map, res,
+ PHI_ARG_DEF (phi, 0),
+ debug);
}
}
}
@@ -426,7 +424,7 @@ rename_ssa_copies (void)
statistics_counter_event (cfun, "copies coalesced",
stats.coalesced);
delete_var_map (map);
- return updated ? TODO_remove_unused_locals : 0;
+ return 0;
}
/* Return true if copy rename is to be performed. */
--- gcc/tree-ssa-ccp.c (revision 196173)
+++ gcc/tree-ssa-ccp.c (revision 196174)
@@ -2108,7 +2108,7 @@ do_ssa_ccp (void)
ccp_initialize ();
ssa_propagate (ccp_visit_stmt, ccp_visit_phi_node);
if (ccp_finalize ())
- todo = (TODO_cleanup_cfg | TODO_update_ssa | TODO_remove_unused_locals);
+ todo = (TODO_cleanup_cfg | TODO_update_ssa);
free_dominance_info (CDI_DOMINATORS);
return todo;
}
--- gcc/tree-call-cdce.c (revision 196173)
+++ gcc/tree-call-cdce.c (revision 196174)
@@ -898,11 +898,10 @@ tree_call_cdce (void)
/* As we introduced new control-flow we need to insert PHI-nodes
for the call-clobbers of the remaining call. */
mark_virtual_operands_for_renaming (cfun);
- return (TODO_update_ssa | TODO_cleanup_cfg | TODO_ggc_collect
- | TODO_remove_unused_locals);
+ return TODO_update_ssa;
}
- else
- return 0;
+
+ return 0;
}
static bool
--- gcc/tree-ssa-live.c (revision 196173)
+++ gcc/tree-ssa-live.c (revision 196174)
@@ -889,7 +889,10 @@ remove_unused_locals (void)
dstidx++;
}
if (dstidx != num)
- cfun->local_decls->truncate (dstidx);
+ {
+ statistics_counter_event (cfun, "unused VAR_DECLs removed", num - dstidx);
+ cfun->local_decls->truncate (dstidx);
+ }
remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));
clear_unused_block_pointer ();
--- gcc/tree-ssa-forwprop.c (revision 196173)
+++ gcc/tree-ssa-forwprop.c (revision 196174)
@@ -2936,7 +2936,6 @@ ssa_forward_propagate_and_combine (void)
&& forward_propagate_addr_expr (lhs, rhs))
{
release_defs (stmt);
- todoflags |= TODO_remove_unused_locals;
gsi_remove (&gsi, true);
}
else
@@ -2961,7 +2960,6 @@ ssa_forward_propagate_and_combine (void)
off)))))
{
release_defs (stmt);
- todoflags |= TODO_remove_unused_locals;
gsi_remove (&gsi, true);
}
else if (is_gimple_min_invariant (rhs))
--- gcc/tree-ssa-dce.c (revision 196173)
+++ gcc/tree-ssa-dce.c (revision 196174)
@@ -1607,10 +1607,8 @@ perform_tree_ssa_dce (bool aggressive)
free_edge_list (el);
if (something_changed)
- return (TODO_update_ssa | TODO_cleanup_cfg | TODO_ggc_collect
- | TODO_remove_unused_locals);
- else
- return 0;
+ return TODO_update_ssa | TODO_cleanup_cfg;
+ return 0;
}
/* Pass entry points. */
--- gcc/passes.c (revision 196173)
+++ gcc/passes.c (revision 196174)
@@ -1918,10 +1918,7 @@ execute_function_todo (void *data)
/* Always cleanup the CFG before trying to update SSA. */
if (flags & TODO_cleanup_cfg)
{
- bool cleanup = cleanup_tree_cfg ();
-
- if (cleanup && (cfun->curr_properties & PROP_ssa))
- flags |= TODO_remove_unused_locals;
+ cleanup_tree_cfg ();
/* When cleanup_tree_cfg merges consecutive blocks, it may
perform some simplistic propagation when removing single
--- gcc/tree-ssanames.c (revision 196173)
+++ gcc/tree-ssanames.c (revision 196174)
@@ -455,7 +455,7 @@ struct gimple_opt_pass pass_release_ssa_
PROP_ssa, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
- 0, /* todo_flags_start */
- 0 /* todo_flags_finish */
+ TODO_remove_unused_locals, /* todo_flags_start */
+ 0 /* todo_flags_finish */
}
};
--- gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c (revision 196173)
+++ gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c (revision 196174)
@@ -11,6 +11,5 @@ int foo(struct X *q)
/* We should have propragated &q->a into (*pointer). */
-/* { dg-final { scan-tree-dump-times "pointer" 0 "forwprop1"} } */
-/* { dg-final { scan-tree-dump "\\\[0\\\]" "forwprop1" } } */
+/* { dg-final { scan-tree-dump "q_.\\\(D\\\)\\\]\\\[0\\\];" "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */

View File

@ -1,4 +1,4 @@
be78a47bd82523250eb3e91646db5b3d cloog-0.18.0.tar.gz be78a47bd82523250eb3e91646db5b3d cloog-0.18.0.tar.gz
2659f09c2e43ef8b7d4406321753f1b2 fastjar-0.97.tar.gz 2659f09c2e43ef8b7d4406321753f1b2 fastjar-0.97.tar.gz
d18630509460934dfd7163a884b63ecd gcc-4.8.0-20130220.tar.bz2
bce1586384d8635a76d2f017fb067cd2 isl-0.11.1.tar.bz2 bce1586384d8635a76d2f017fb067cd2 isl-0.11.1.tar.bz2
4f89409558bba0856fbd26778fd49841 gcc-4.8.0-20130304.tar.bz2