Skip to content

Commit 1a1676f

Browse files
committed
intel fix: do not access unallocated flags
1 parent 270f102 commit 1a1676f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/fpm.f90

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,19 @@ subroutine new_compiler_flags(model,settings)
318318

319319
character(len=:), allocatable :: flags, cflags, cxxflags, ldflags
320320

321-
if (settings%flag == '') then
322-
flags = model%compiler%get_default_flags(settings%profile == "release")
323-
else
321+
if (len(settings%flag)>0) then
322+
324323
flags = settings%flag
324+
325+
elseif (allocated(settings%profile)) then
326+
325327
select case(settings%profile)
326328
case("release", "debug")
327-
flags = flags // model%compiler%get_default_flags(settings%profile == "release")
328-
end select
329-
end if
329+
flags = model%compiler%get_default_flags(release = .true.)
330+
case ("debug")
331+
flags = model%compiler%get_default_flags(release = .false.)
332+
end select
333+
end if
330334

331335
cflags = trim(settings%cflag)
332336
cxxflags = trim(settings%cxxflag)

0 commit comments

Comments
 (0)