diff --git a/CMakeLists.txt b/CMakeLists.txt index 50f1c99fd..a42dea63d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -512,13 +512,6 @@ else() endif(WIN32) endif() -# Disable strict aliasing optimizations. -# It could re-enabled back by a flag passed in CFLAGS_EXTRA. -check_c_compiler_flag(-fno-strict-aliasing HAVE_FLAG_F_NO_STRICT_ALIASING) -if (HAVE_FLAG_F_NO_STRICT_ALIASING) - add_compile_options(-fno-strict-aliasing) -endif() - # Extra user-defined flags to pass both to C and C++ compilers. if (DEFINED CFLAGS_EXTRA) separate_arguments(CFLAGS_EXTRA_LIST UNIX_COMMAND "${CFLAGS_EXTRA}") diff --git a/build.zig b/build.zig index cf39da61b..b622a9a86 100644 --- a/build.zig +++ b/build.zig @@ -374,12 +374,11 @@ pub fn build(b: *std.Build) void { // TODO: declare that the libraries do not refer to external symbols // of build_shared_libs. - // zig cc supports these flags. + // zig cc supports this flag. flags.appendSlice(&.{ // TODO: -Wno-unused-command-line-argument // Prevent "__builtin_return_address with nonzero argument is unsafe". "-Wno-frame-address", - "-fno-strict-aliasing", }) catch unreachable; if (build_shared_libs) { diff --git a/configure.ac b/configure.ac index 6496ffce8..b2c3fe2d0 100644 --- a/configure.ac +++ b/configure.ac @@ -432,31 +432,6 @@ fi AM_CONDITIONAL([ASM_WITH_CPP_UNSUPPORTED], [test $compiler_xlc = yes -o $compiler_suncc = yes]) -if test "$GCC" = yes; then - # Disable aliasing optimization unless forced to. - AC_MSG_CHECKING([whether compiler supports -fno-strict-aliasing]) - ac_cv_fno_strict_aliasing=no - for cflag in $CFLAGS; do - case "$cflag" in - -fstrict-aliasing) - # Opposite option already present - ac_cv_fno_strict_aliasing=skipped - break - ;; - esac - done - if test "$ac_cv_fno_strict_aliasing" != skipped; then - old_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-strict-aliasing" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], - [ac_cv_fno_strict_aliasing=yes]) - CFLAGS="$old_CFLAGS" - AS_IF([test "$ac_cv_fno_strict_aliasing" = yes], - [CFLAGS="$CFLAGS -fno-strict-aliasing"]) - fi - AC_MSG_RESULT($ac_cv_fno_strict_aliasing) -fi - # Check for getcontext (uClibc can be configured without it, for example) AC_CHECK_FUNC([getcontext], [], [AC_DEFINE([NO_GETCONTEXT], [1], [Missing getcontext function.])]) diff --git a/docs/platforms/README.win64 b/docs/platforms/README.win64 index ed30665e0..7625366f9 100644 --- a/docs/platforms/README.win64 +++ b/docs/platforms/README.win64 @@ -23,5 +23,3 @@ support - this could be done by passing "disable_threads=1" argument to nmake. Note that some warnings have been explicitly turned off in the makefile. VC++ note: to suppress warnings -D_CRT_SECURE_NO_DEPRECATE is used. - -gcc note: -fno-strict-aliasing should be used if optimizing. diff --git a/extra/gc.c b/extra/gc.c index 83578fb64..76e41399b 100644 --- a/extra/gc.c +++ b/extra/gc.c @@ -22,7 +22,7 @@ /* Tip: to get the highest level of compiler optimizations, the typical */ /* compiler options (GCC) to use are: */ -/* -O3 -fno-strict-aliasing -march=native -Wall -fprofile-generate/use */ +/* -O3 -march=native -Wall -fprofile-generate/use */ /* Warning: GCC for Linux (for C++ clients only): Use -fexceptions both */ /* for GC and the client otherwise GC_thread_exit_proc() is not */