Skip to content

Commit 721c806

Browse files
committed
Switch power to use O3 instead of Ofast
Ofast enables possibly unsafe optimizations in addition to O3. This appears to have been added and then just continually copied into later Power architectures, and it wasn't included in the CMake build system when that was introduced. Replace this with O3 so that the same level of optimization is done by the compiler.
1 parent 4e6da5e commit 721c806

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Makefile.power

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ ifeq ($(CORE), POWER10)
1313
ifneq ($(C_COMPILER), PGI)
1414
ifeq ($(C_COMPILER), GCC)
1515
ifeq ($(GCCVERSIONGTEQ10), 1)
16-
CCOMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
16+
CCOMMON_OPT += -O3 -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
1717
else ifneq ($(GCCVERSIONGT4), 1)
1818
$(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended)
19-
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
19+
CCOMMON_OPT += -O3 -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
2020
else
2121
$(warning your compiler is too old to fully support POWER10, getting a newer version of gcc is recommended)
22-
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -fno-fast-math
22+
CCOMMON_OPT += -O3 -mcpu=power9 -mtune=power9 -mvsx -fno-fast-math
2323
endif
2424
else
25-
CCOMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
25+
CCOMMON_OPT += -O3 -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
2626
endif
2727
ifeq ($(F_COMPILER), IBM)
2828
FCOMMON_OPT += -O2 -qrecur -qnosave -qarch=pwr10 -qtune=pwr10 -qfloat=nomaf -qzerosize
@@ -34,7 +34,7 @@ endif
3434

3535
ifeq ($(CORE), POWER9)
3636
ifneq ($(C_COMPILER), PGI)
37-
CCOMMON_OPT += -Ofast -mvsx -fno-fast-math
37+
CCOMMON_OPT += -O3 -mvsx -fno-fast-math
3838
ifeq ($(C_COMPILER), GCC)
3939
ifneq ($(GCCVERSIONGT4), 1)
4040
$(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended)
@@ -70,7 +70,7 @@ endif
7070

7171
ifeq ($(CORE), POWER8)
7272
ifneq ($(C_COMPILER), PGI)
73-
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
73+
CCOMMON_OPT += -O3 -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
7474
else
7575
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align
7676
endif

0 commit comments

Comments
 (0)