aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-09-27 10:42:47 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-09-27 10:44:04 +0000
commit75d6ffbc74b6afd851387a24d9dc8c0689d19197 (patch)
tree12e8722e39d901e027b115b4a706e8da9b0160f9
parenta99b66d95b4df64d20b6a9cf78106b472a68b1dc (diff)
Revert "Focus -Wno-over-aligned to just 32-bit x86 Android."
This reverts commit If8a2898ab3a77571622eb125c97f676e029b902c. Reason for revert: ../../../../../work/skia/tests/OverAlignedTest.cpp: In function 'void test_OverAligned(skiatest::Reporter*, sk_gpu_test::GrContextFactory*)': ../../../../../work/skia/tests/OverAlignedTest.cpp:19:33: error: invalid operands of types 'void*' and 'int' to binary 'operator&' REPORTER_ASSERT(r, SkIsAlign8(p)); ^ ninja: build stopped: subcommand failed. Original issue's description: > Focus -Wno-over-aligned to just 32-bit x86 Android. > > I've even found the code that's making this happen, just don't know why. > I've added a test to assert that it's safe to assume malloc() is 8-byte aligned. > > BUG=skia: > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2662 > > CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-GN_Android-Trybot > TBR=mtklein@chromium.org,bungeman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ic9b30ce980d8d5155528a6f2b4e1913e5fa95dc0 Reviewed-on: https://skia-review.googlesource.com/2702 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
-rw-r--r--gn/BUILD.gn7
-rw-r--r--tests/OverAlignedTest.cpp22
2 files changed, 2 insertions, 27 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 614a069dff..0ae8eeca0e 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -83,11 +83,8 @@ config("default") {
"-Wno-unknown-warning-option", # Let older Clangs ignore newer Clangs' warnings.
]
- if (is_android && target_cpu == "x86") {
- # Clang seems to think new/malloc will only be 4-byte aligned on x86 Android.
- # We're pretty sure it's actually 8-byte alignment.
- cflags += [ "-Wno-over-aligned" ]
- }
+ # High priority to fix!
+ cflags += [ "-Wno-over-aligned" ]
cflags += [
"-Wno-cast-align",
diff --git a/tests/OverAlignedTest.cpp b/tests/OverAlignedTest.cpp
deleted file mode 100644
index ed4bb7456d..0000000000
--- a/tests/OverAlignedTest.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "Test.h"
-#include "SkRandom.h"
-
-// Clang seems to think only 32-bit alignment is guaranteed on 32-bit x86 Android.
-// See https://reviews.llvm.org/D8357
-// This is why we have disabled -Wover-aligned there (we allocate 8-byte aligned structs in Ganesh).
-DEF_TEST(OverAligned, r) {
- SkRandom rand;
- // Let's test that assertion. We think it really should be providing 8-byte alignment.
- for (int i = 0; i < 1000; i++) {
- void* p = malloc(rand.nextRangeU(0,100));
- REPORTER_ASSERT(r, SkIsAlign8(p));
- free(p);
- }
-}