Skip to content

Commit 79cdcde

Browse files
authored
Re-enable higher optimization levels for flang while disabling loop unrolling for AOCC flang
1 parent 1dd7121 commit 79cdcde

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Makefile.system

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,14 @@ endif
784784
ifeq ($(F_COMPILER), FLANG)
785785
CCOMMON_OPT += -DF_INTERFACE_FLANG
786786
FCOMMON_OPT += -Mrecursive -Kieee
787+
ifeq ($(OSNAME), Linux)
788+
ifeq ($(ARCH), x86_64)
789+
FLANG_VENDOR := $(shell expr `$(FC) --version|cut -f 1 -d "."|head -1`)
790+
ifeq ($(FLANG_VENDOR),AOCC)
791+
FCOMMON_OPT += -fno-unroll-loops
792+
endif
793+
endif
794+
endif
787795
ifdef BINARY64
788796
ifdef INTERFACE64
789797
ifneq ($(INTERFACE64), 0)
@@ -1271,11 +1279,7 @@ endif
12711279

12721280
override CFLAGS += $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR)
12731281
override PFLAGS += $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR) -DPROFILE $(COMMON_PROF)
1274-
ifeq ($(F_COMPILER),FLANG)
1275-
override FFLAGS += $(filter-out -O2 -O3,$(COMMON_OPT)) -O1 $(FCOMMON_OPT)
1276-
else
12771282
override FFLAGS += $(COMMON_OPT) $(FCOMMON_OPT)
1278-
endif
12791283
override FPFLAGS += $(FCOMMON_OPT) $(COMMON_PROF)
12801284
#MAKEOVERRIDES =
12811285

0 commit comments

Comments
 (0)