From 227c33583a4074d3cfdf869abf000a96daf6d007 Mon Sep 17 00:00:00 2001 From: Khavish Anshudass Bhundoo Date: Sat, 11 Mar 2017 11:44:45 +0400 Subject: [PATCH 1/2] warning: 'assume_aligned' attribute directive ignored --- butteraugli/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/butteraugli/Makefile b/butteraugli/Makefile index 76b3a9b..c9a45fe 100755 --- a/butteraugli/Makefile +++ b/butteraugli/Makefile @@ -1,6 +1,7 @@ LDLIBS += -lpng -ljpeg CXXFLAGS += -std=c++11 -I.. LINK.o = $(LINK.cc) +CFLAGS += $(echo 'void* my_alloc1() __attribute__((assume_aligned(16)));' | gcc -x c - -c -o /dev/null -Werror && echo -DHAS_ASSUME_ALIGNED) all: butteraugli.o butteraugli_main.o butteraugli From 5091fbabb5c31049a56eeba7c90aa7b343d10e81 Mon Sep 17 00:00:00 2001 From: Khavish Anshudass Bhundoo Date: Sat, 11 Mar 2017 11:47:27 +0400 Subject: [PATCH 2/2] warning: 'assume_aligned' attribute directive ignored --- butteraugli/butteraugli.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/butteraugli/butteraugli.h b/butteraugli/butteraugli.h index 31824b8..844fd8b 100755 --- a/butteraugli/butteraugli.h +++ b/butteraugli/butteraugli.h @@ -123,10 +123,11 @@ bool ButteraugliAdaptiveQuantization(size_t xsize, size_t ysize, #define BUTTERAUGLI_RESTRICT __restrict__ #endif -#ifdef _MSC_VER -#define BUTTERAUGLI_CACHE_ALIGNED_RETURN /* not supported */ -#else + +#ifdef HAS_ASSUME_ALIGNED #define BUTTERAUGLI_CACHE_ALIGNED_RETURN __attribute__((assume_aligned(64))) +#else +#define BUTTERAUGLI_CACHE_ALIGNED_RETURN /* not supported */ #endif // Alias for unchangeable, non-aliased pointers. T is a pointer type,