Skip to content

Commit 09f28c0

Browse files
committed
[Fortran] Add missing unsupported LLVM Flang options
See the following patches in LLVM Flang for context: * https://reviews.llvm.org/D157837 * https://reviews.llvm.org/D158307 Differential Revision: https://reviews.llvm.org/D158308
1 parent 88608eb commit 09f28c0

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ set(LLVM_CODESIGNING_IDENTITY "" CACHE STRING
5555
add_definitions(-DNDEBUG)
5656
option(TEST_SUITE_SUPPRESS_WARNINGS "Suppress all warnings" ON)
5757
if(${TEST_SUITE_SUPPRESS_WARNINGS})
58-
add_definitions(-w)
58+
if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
59+
# NOTE: ATM (18/8/23) LLVM Flang does not support the -w flag.
60+
# FIXME: Don't use add_definitions to add compiler flags
61+
add_definitions(-w)
62+
endif()
5963
endif()
6064

6165
# We want reproducible builds, so using __DATE__ and __TIME__ is bad

Fortran/gfortran/CMakeLists.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,22 @@ set(TEST_SUITE_FORTRAN_ISO_C_HEADER_DIR "" CACHE STRING
6363
# be because they are currently unsupported and might eventually be supported
6464
# or because they are GCC-specific and will never be supported.
6565
set(FLANG_ERRORING_FFLAGS
66+
max-completely-peel-loop-nest-depth=1
6667
-fallow-invalid-boz
68+
-fcheck-array-temporaries
69+
-fcheck=bounds
70+
-fcheck=do
71+
-fcheck=recursion
72+
-fcoarray=lib
6773
-fdec
6874
-fdec-format-defaults
6975
-fdec-static
7076
-fdec-structure
77+
-frecord-marker=4
78+
-fbounds-check
79+
-fcheck-bounds
80+
-fcheck=all
81+
-fcheck=bits
7182
# Not sure if the -fdefault-* options will be supported. Maybe in a different
7283
# form in which case, this will have to be modified to accommodate those.
7384
-fdefault-real-10
@@ -91,7 +102,11 @@ set(FLANG_ERRORING_FFLAGS
91102
-fdump-tree-profile-estimate
92103
-fdump-tree-reassoc1
93104
-fdump-tree-vect-details
105+
-fexpensive-optimizations
94106
-ff2c
107+
-ffree-line-length-none
108+
-ffrontend-optimize
109+
-fgcse
95110
-finline-matmul-limit=0
96111
-finline-matmul-limit=10
97112
-finline-matmul-limit=100
@@ -102,19 +117,35 @@ set(FLANG_ERRORING_FFLAGS
102117
-fipa-cp-clone
103118
-fipa-pta
104119
-fipa-reference
120+
-fmodulo-sched
121+
-fno-align-commons
122+
-fno-asynchronous-unwind-tables
123+
-fno-backtrace
124+
-fno-bounds-check
125+
-fno-check-array-temporaries
105126
-fno-dec
127+
-fno-f2c
128+
-fno-frontend-optimize
106129
-fno-guess-branch-probability
130+
-fno-inline
107131
-fno-ipa-cp
108132
-fno-ipa-modref
109133
-fno-ipa-sra
110134
-fno-pad-source
135+
-fno-range-check
136+
-fno-realloc-lhs
137+
-fno-sign-zero
111138
-fno-tree-ccp
112139
-fno-tree-forwprop
113140
-fno-tree-fre
114141
-fno-tree-loop-optimize
115142
-fno-tree-loop-vectorize
116143
-fpad-source
144+
-fpeel-loops
145+
-frecursive
146+
-fsanitize=undefined
117147
-fset-g77-defaults
148+
-fshort-enums
118149
-ftest-forall-temp
119150
-ftree-loop-distribution
120151
-ftree-loop-vectorize
@@ -123,6 +154,8 @@ set(FLANG_ERRORING_FFLAGS
123154
-ftree-tail-merge
124155
-ftree-vectorize
125156
-ftree-vrp
157+
-funroll-loops
158+
-fwrapv
126159
-mdalign
127160
-mdejagnu-cpu=power4
128161
-mfpmath=387
@@ -134,6 +167,7 @@ set(FLANG_ERRORING_FFLAGS
134167
-Os
135168
# At some point, if we ever support explicit standard flags, some of these
136169
# should be removed.
170+
-pedantic-errors
137171
-std=gnu
138172
-std=legacy
139173
-std=f95
@@ -183,6 +217,8 @@ set(FLANG_ERRORING_FFLAGS
183217
-Wunused-parameter
184218
-Wunused-variable
185219
-Wzerotrip
220+
-w
221+
--param
186222
)
187223

188224
# Find all the Fortran files in the current source directory that may be test

0 commit comments

Comments
 (0)