Skip to content

Commit bd3728b

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents f1df29a + d6a91b8 commit bd3728b

File tree

554 files changed

+22324
-502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

554 files changed

+22324
-502
lines changed

Fortran/gfortran/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ set(FLANG_ERRORING_FFLAGS
109109
-fbounds-check
110110
-fcheck-array-temporaries
111111
-fcheck=all
112+
-fcheck=array-temps
112113
-fcheck=bits
113114
-fcheck=bounds
114115
-fcheck=do
@@ -131,6 +132,7 @@ set(FLANG_ERRORING_FFLAGS
131132
-fcheck-bounds
132133
-fcheck=all
133134
-fcheck=bits
135+
-fcheck=no-bounds
134136
# Not sure if the -fdefault-* options will be supported. Maybe in a different
135137
# form in which case, this will have to be modified to accommodate those.
136138
-fdefault-real-10
@@ -666,9 +668,7 @@ function(gfortran_add_compile_test expect_error main others fflags ldflags)
666668
-DALWAYS_SAVE_DIAGS=OFF
667669
-DWORKING_DIRECTORY=${working_dir}
668670
-DOUTPUT_FILE=${out}
669-
-P ${COMPILE_SCRIPT_BIN}
670-
USES_TERMINAL
671-
COMMENT "Compiling ${main}")
671+
-P ${COMPILE_SCRIPT_BIN})
672672

673673
add_custom_target(${target}
674674
ALL
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
! { dg-do compile }
2+
! { dg-options "-Ofast" }
3+
SUBROUTINE sedi_1D(QX1d, DZ1d,kdir,BX1d,kbot,ktop)
4+
real, dimension(:) :: QX1d,DZ1d
5+
real, dimension(size(QX1d)) :: VVQ
6+
logical BX_present
7+
do k= kbot,ktop,kdir
8+
VVQ= VV_Q0
9+
enddo
10+
Vxmaxx= min0
11+
if (kdir==1) then
12+
dzMIN = minval(DZ1d)
13+
endif
14+
npassx= Vxmaxx/dzMIN
15+
DO nnn= 1,npassx
16+
if (BX_present) then
17+
do k= ktop,kdir
18+
BX1d= iDZ1d0
19+
enddo
20+
endif
21+
ENDDO
22+
END
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
! { dg-do compile }
2+
! { dg-options "-Ofast" }
3+
subroutine shr_map_checkFldStrshr_map_mapSet_dest(ndst,max0,eps,sum0,maxval0,min0,nidnjd,renorm)
4+
allocatable sum(:)
5+
logical renorm
6+
allocate(sum(ndst))
7+
do n=1,ndst
8+
if (sum0 > eps) then
9+
rmax = max0
10+
endif
11+
enddo
12+
if (renorm) then
13+
rmin = maxval0
14+
rmax = minval(sum)
15+
do n=1,nidnjd
16+
if (sum0 > eps) then
17+
rmin = min0
18+
endif
19+
enddo
20+
write(*,*) rmin,rmax
21+
endif
22+
end

Fortran/gfortran/regression/DisabledFiles.cmake

Lines changed: 113 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ file(GLOB UNSUPPORTED_FILES CONFIGURE_DEPENDS
119119
unlimited_polymorphic_14.f90
120120
# Unsupported predefined macro: __TIMESTAMP__
121121
wdate-time.F90
122+
123+
# This test checks that two arrays, initialized with random real numbers that
124+
# are converted to integers, are not identical. It is possible, though
125+
# unlikely for such "randomly initialized" arrays to be identical. Because of
126+
# this inherent flakiness, this test will remain unsupported.
127+
random_init_2.f90
128+
129+
# Test is not conformant as it writes to a constant argument
130+
# Similar test, that is conformant, added to UnitTests/assign-goto
131+
assign_5.f90
132+
133+
# Test is not conformant as it expects different value of cmdstat and cmdmsg
134+
# Similar test added: UnitTests/execute_command_line
135+
execute_command_line_1.f90
136+
execute_command_line_3.f90
122137
)
123138

124139
# These tests are skipped because they hit a 'not yet implemented' assertion
@@ -165,6 +180,13 @@ file(GLOB UNIMPLEMENTED_FILES CONFIGURE_DEPENDS
165180
unlimited_polymorphic_1.f03
166181
unlimited_polymorphic_32.f90
167182

183+
# unimplemented: assumed-rank variable in procedure implemented in Fortran
184+
associate_66.f90
185+
bind_c_optional-2.f90
186+
intent_out_19.f90
187+
intent_out_20.f90
188+
shape_12.f90
189+
168190
# unimplemented: ASYNCHRONOUS in procedure interface
169191
assumed_rank_13.f90
170192
asynchronous_3.f03
@@ -284,11 +306,6 @@ file(GLOB UNIMPLEMENTED_FILES CONFIGURE_DEPENDS
284306
# unimplemented: intrinsic: co_broadcast
285307
coarray_collectives_17.f90
286308

287-
# Test is not conformant as it expects different value of cmdstat and cmdmsg
288-
# Similar test added: UnitTests/execute_command_line
289-
execute_command_line_1.f90
290-
execute_command_line_3.f90
291-
292309
# unimplemented: intrinsic: failed_images
293310
coarray_failed_images_1.f08
294311

@@ -351,6 +368,7 @@ file(GLOB UNIMPLEMENTED_FILES CONFIGURE_DEPENDS
351368
pdt_25.f03
352369
pdt_27.f03
353370
pdt_28.f03
371+
pdt_36.f03
354372
pdt_7.f03
355373
pdt_9.f03
356374
pr95826.f90
@@ -541,6 +559,7 @@ file(GLOB SKIPPED_FILES CONFIGURE_DEPENDS
541559

542560
# error: No intrinsic or user-defined ASSIGNMENT(=) matches operand types
543561
# 'TYPE 1' and 'TYPE 2'
562+
assumed_type_18.f90
544563
dec-comparison-complex_1.f90
545564
dec-comparison-complex_2.f90
546565
dec-comparison-int_1.f90
@@ -853,6 +872,37 @@ file(GLOB SKIPPED_FILES CONFIGURE_DEPENDS
853872
include_19.f90
854873
include_20.f90
855874
include_8.f90
875+
876+
# ----------------------------------------------------------------------------
877+
#
878+
# These tests require 128-bit integer support. Since we do not process
879+
# DejaGNU directives to conditionally disable such tests, they are always
880+
# disabled until we can conditionally run such tests
881+
selected_logical_kind_3.f90
882+
883+
# error: conflicting debug info for argument
884+
entry_6.f90
885+
886+
# error: Only -std=f2018 is allowed currently.
887+
continuation_19.f
888+
889+
# error: Must be a constant value
890+
pdt_33.f03
891+
892+
# error: 'foo_size' is not a procedure
893+
pr103312.f90
894+
895+
# error: Actual argument type '__builtin_c_ptr' is not compatible with dummy
896+
# argument type 'c_ptr'
897+
pr108961.f90
898+
899+
# error: Procedure pointer 'op' with implicit interface may not be associated
900+
# with procedure designator 'new_t' with explicit interface that cannot be
901+
# called via an implicit interface
902+
pr112407a.f90
903+
904+
# This causes a segmentation fault at run-time.
905+
ishftc_optional_size_1.f90
856906
)
857907

858908
# These tests are disabled because they fail when they are expected to pass.
@@ -968,24 +1018,20 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
9681018
widechar_IO_4.f90
9691019
zero_sized_1.f90
9701020
elemental_function_2.f90
1021+
do_check_1.f90
1022+
random_3.f90
9711023

9721024
# These tests fail at runtime on AArch64 (but pass on x86). Disable them
9731025
# anyway so the test-suite passes by default on AArch64.
9741026
entry_23.f
9751027
findloc_8.f90
1028+
pr99210.f90
9761029

977-
# These tests fail on Ubuntu because of a bug in the not utility. At least
978-
# some of these should work once the issue with not has been fixed.
979-
#
980-
# https://github.com/llvm/llvm-test-suite/pull/102#issuecomment-1980674221
981-
#
982-
do_check_1.f90
1030+
# These tests go into an infinite loop printing "Hello World"
9831031
pointer_check_1.f90
9841032
pointer_check_2.f90
9851033
pointer_check_3.f90
9861034
pointer_check_4.f90
987-
random_3.f90
988-
unpack_bounds_1.f90
9891035

9901036
# ---------------------------------------------------------------------------
9911037
#
@@ -1009,6 +1055,7 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
10091055
no_unit_error_1.f90
10101056
pointer_check_10.f90
10111057
pointer_remapping_6.f08
1058+
unpack_bounds_1.f90
10121059

10131060
# ---------------------------------------------------------------------------
10141061
#
@@ -1367,10 +1414,6 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
13671414
directive_unroll_5.f90
13681415
# Tests "!GCC$ attributes weak :: x"
13691416
weak-3.f90
1370-
# Test is not conformant as it writes to a constant argument
1371-
# Similar test, that is conformant, added to UnitTests/assign-goto
1372-
assign_5.f90
1373-
13741417

13751418
# Probable bugs
13761419
# ["a", "ab"]
@@ -1438,6 +1481,9 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
14381481
# error: No explicit type declared for 'arg4'
14391482
unused_artificial_dummies_1.f90
14401483

1484+
# Invalid specification expression: reference to OPTIONAL dummy argument
1485+
allocatable_length_2.f90
1486+
14411487
# Valid errors
14421488
# Valid out-of-bounds subscript errors, are warnings in gfortran
14431489
bounds_check_3.f90
@@ -1730,7 +1776,7 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
17301776
bounds_check_17.f90
17311777
pr48958.f90
17321778

1733-
# These files require the __truncsfbf2 intrinsic that is not available in
1779+
# These files require the __truncsfbf2 intrinsic that is not available
17341780
# before GCC 13. Alternatively, it requires compiler-rt to be built and a
17351781
# command line option provided to instruct the compiler to use it. Currently,
17361782
# we do not support either a version check on GCC or require that compiler-rt
@@ -1748,4 +1794,53 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS
17481794
# __trampoline_setup. This is probably an unrelated issue, but as a quick fix
17491795
# for the buildbot, this is disabled.
17501796
internal_dummy_2.f08
1797+
1798+
# The causes of failure of these tests need to be investigated
1799+
PR113061.f90
1800+
allocate_with_source_29.f90
1801+
boz_8.f90
1802+
continuation_18.f90
1803+
data_initialized_4.f90
1804+
data_pointer_3.f90
1805+
date_and_time_2.f90
1806+
interface_50.f90
1807+
interface_procedure_1.f90
1808+
iso_fortran_env_9.f90
1809+
line_length_12.f90
1810+
oldstyle_5.f
1811+
pdt_34.f03
1812+
pdt_35.f03
1813+
pr104555.f90
1814+
pr112407b.f90
1815+
pr114883.f90
1816+
pr25623-2.f90
1817+
pr25623.f90
1818+
pr43984.f90
1819+
pr88624.f90
1820+
pr99139.f90
1821+
pr99368.f90
1822+
reshape_10.f90
1823+
selected_logical_kind_2.f90
1824+
submodule_3.f08
1825+
submodule_33.f08
1826+
achar_2.f90
1827+
allocate_with_source_30.f90
1828+
allocate_with_source_31.f90
1829+
backslash_1.f90
1830+
bound_11.f90
1831+
bounds_check_fail_6.f90
1832+
bounds_check_fail_7.f90
1833+
finalize_56.f90
1834+
internal_dummy_2.f08
1835+
iso_fortran_env_8.f90
1836+
optional_absent_12.f90
1837+
pr103389.f90
1838+
pr105456-nmlr.f90
1839+
pr105473.f90
1840+
pr111022.f90
1841+
pr114304.f90
1842+
zero_sized_15.f90
1843+
1844+
# Test needs to add -pedantic to show the error
1845+
pr32601.f03
17511846
)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
! { dg-do compile }
2+
! { dg-options "-Warray-temporaries" }
3+
! Test fix for incorrectly passing array component to unlimited polymorphic procedure
4+
5+
module test_PR105658_mod
6+
implicit none
7+
type :: foo
8+
integer :: member1
9+
integer :: member2
10+
end type foo
11+
contains
12+
subroutine print_poly(array)
13+
class(*), dimension(:), intent(in) :: array
14+
select type(array)
15+
type is (integer)
16+
print*, array
17+
type is (character(*))
18+
print *, array
19+
end select
20+
end subroutine print_poly
21+
22+
subroutine do_print(thing)
23+
type(foo), dimension(3), intent(in) :: thing
24+
type(foo), parameter :: y(3) = [foo(1,2),foo(3,4),foo(5,6)]
25+
integer :: i, j, uu(5,6)
26+
27+
call print_poly(thing%member1) ! { dg-warning "array temporary" }
28+
call print_poly(y%member2) ! { dg-warning "array temporary" }
29+
call print_poly(y(1::2)%member2) ! { dg-warning "array temporary" }
30+
31+
! The following array sections work without temporaries
32+
uu = reshape([(((10*i+j),i=1,5),j=1,6)],[5,6])
33+
print *, uu(2,2::2)
34+
call print_poly (uu(2,2::2)) ! no temp needed!
35+
print *, uu(1::2,6)
36+
call print_poly (uu(1::2,6)) ! no temp needed!
37+
end subroutine do_print
38+
39+
subroutine do_print2(thing2)
40+
class(foo), dimension(:), intent(in) :: thing2
41+
call print_poly (thing2% member2) ! { dg-warning "array temporary" }
42+
end subroutine do_print2
43+
44+
subroutine do_print3 ()
45+
character(3) :: c(3) = ["abc","def","ghi"]
46+
call print_poly (c(1::2)) ! no temp needed!
47+
call print_poly (c(1::2)(2:3)) ! { dg-warning "array temporary" }
48+
end subroutine do_print3
49+
50+
end module test_PR105658_mod
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
! { dg-do compile }
2+
! { dg-options "-fno-move-loop-invariants -Oz" }
3+
module module_foo
4+
use iso_c_binding
5+
contains
6+
subroutine foo(a) bind(c)
7+
type(c_ptr) a(..)
8+
select rank(a)
9+
end select
10+
call bar
11+
end
12+
end

Fortran/gfortran/regression/allocatable_function_1.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ function bar (n) result(b)
107107
end function bar
108108

109109
end program alloc_fun
110-
! { dg-final { scan-tree-dump-times "free" 10 "original" } }
110+
! { dg-final { scan-tree-dump-times "__builtin_free " 10 "original" } }

0 commit comments

Comments
 (0)