Commit 76b75624 authored by Mike Hamburg's avatar Mike Hamburg

Thanks again Samuel Neves: the "gcc bug" is actually undefined behavior caused...

Thanks again Samuel Neves: the "gcc bug" is actually undefined behavior caused by strict aliasing.  For now just passing -fno-strict-aliasing, maybe unions to fix it later
parent 94c51dd2
......@@ -26,7 +26,7 @@ WARNFLAGS = -pedantic -Wall -Wextra -Werror -Wunreachable-code \
INCFLAGS = -Isrc/include -Iinclude -Isrc/$(ARCH)
LANGFLAGS = -std=c99
LANGFLAGS = -std=c99 -fno-strict-aliasing
GENFLAGS = -ffunction-sections -fdata-sections -fvisibility=hidden -fomit-frame-pointer -fPIC
OFLAGS = -O3
......
......@@ -89,21 +89,11 @@ p448_is_zero (
const p448_t *in
);
static
#ifndef GCC_HAS_A_BUG_SO_DONT_INLINE_FIELD_BIAS
__inline__
#endif
void
static __inline__ void
p448_bias (
p448_t *inout,
int amount
)
#ifdef GCC_HAS_A_BUG_SO_DONT_INLINE_FIELD_BIAS
__attribute__((unused,noinline,optimize("O1")))
#else
__attribute__((unused,always_inline))
#endif
;
) __attribute__((unused,always_inline));
void
p448_mul (
......
/* Copyright (c) 2014 Cryptography Research, Inc.
* Released under the MIT License. See LICENSE.txt for license information.
*/
#if (defined(__GNUC__) && !defined(__clang__) && defined(__x86_64__))
/* This works around an apparent compiler bug in GCC, thanks Samuel Neves */
#define GCC_HAS_A_BUG_SO_DONT_INLINE_FIELD_BIAS
#endif
#include "word.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment