From b03e9c2b871a223ffcf152d233945031361e8be1 Mon Sep 17 00:00:00 2001 From: jakub Date: Mon, 23 Feb 2015 21:01:57 +0000 Subject: [PATCH] PR bootstrap/63888 * asan/asan_globals.cc (RegisterGlobal): Disable detect_odr_violation support until it is rewritten upstream. * c-c++-common/asan/pr63888.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220919 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/c-c++-common/asan/pr63888.c | 34 +++++++++++++++++++++++++++++++ libsanitizer/ChangeLog | 6 ++++++ libsanitizer/asan/asan_globals.cc | 4 +++- 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/c-c++-common/asan/pr63888.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4c894b6f564..2c1b9170adf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-02-20 Jakub Jelinek + + PR bootstrap/63888 + * c-c++-common/asan/pr63888.c: New test. + 2015-02-23 Oleg Endo PR target/65163 diff --git a/gcc/testsuite/c-c++-common/asan/pr63888.c b/gcc/testsuite/c-c++-common/asan/pr63888.c new file mode 100644 index 00000000000..a88c860d60b --- /dev/null +++ b/gcc/testsuite/c-c++-common/asan/pr63888.c @@ -0,0 +1,34 @@ +/* PR bootstrap/63888 */ +/* { dg-do run } */ + +__attribute__((noinline, noclone)) int +foo (int x) +{ + int v = 0; + switch (x) + { + case 11: v = 67; break; + case 12: v = 68; break; + case 13: v = 69; break; + } + return v; +} + +__attribute__((noinline, noclone)) int +bar (int x) +{ + int v = 0; + switch (x) + { + case 18: v = 67; break; + case 19: v = 68; break; + case 20: v = 69; break; + } + return v; +} + +int +main () +{ + return foo (11) - 67 + bar (19) - 68; +} diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 083fd775aac..b106907fa46 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,9 @@ +2015-02-20 Jakub Jelinek + + PR bootstrap/63888 + * asan/asan_globals.cc (RegisterGlobal): Disable detect_odr_violation + support until it is rewritten upstream. + 2015-01-26 Matthias Klose * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC. diff --git a/libsanitizer/asan/asan_globals.cc b/libsanitizer/asan/asan_globals.cc index ee2ecdcc957..4bb88cfa001 100644 --- a/libsanitizer/asan/asan_globals.cc +++ b/libsanitizer/asan/asan_globals.cc @@ -148,7 +148,9 @@ static void RegisterGlobal(const Global *g) { CHECK(AddrIsInMem(g->beg)); CHECK(AddrIsAlignedByGranularity(g->beg)); CHECK(AddrIsAlignedByGranularity(g->size_with_redzone)); - if (flags()->detect_odr_violation) { + // This "ODR violation" detection is fundamentally incompatible with + // how GCC registers globals. Disable as useless until rewritten upstream. + if (0 && flags()->detect_odr_violation) { // Try detecting ODR (One Definition Rule) violation, i.e. the situation // where two globals with the same name are defined in different modules. if (__asan_region_is_poisoned(g->beg, g->size_with_redzone)) { -- 2.11.4.GIT