From 7cd0c20fe75b9ba3fbc1e3bdcb95e230dfb8285d Mon Sep 17 00:00:00 2001 From: Slava Zakharin Date: Thu, 12 Dec 2024 09:30:44 -0800 Subject: [PATCH] [Fortran/gfortran] Use -O0 for cshift_bounds_[34]. (#191) * [Fortran/gfortran] Use -O0 for cshift_bounds_[34]. There is no support for `-fbounds-check` in Flang yet. There is a related feature request at https://github.com/orgs/llvm/projects/12?pane=issue&itemId=29048733 Until then, the optimizations may replace the Fortran runtime calls (which usually provide all the error checking) with inline sequences that do not check for errors to provide the fast code (e.g. https://github.com/llvm/llvm-project/pull/119480). For the time being I would like to explicitly pass `-O0` to these tests. * Disabled tests. * Reverted tests.cmake --- Fortran/gfortran/regression/DisabledFiles.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Fortran/gfortran/regression/DisabledFiles.cmake b/Fortran/gfortran/regression/DisabledFiles.cmake index 08f189529..ef2a9416c 100644 --- a/Fortran/gfortran/regression/DisabledFiles.cmake +++ b/Fortran/gfortran/regression/DisabledFiles.cmake @@ -1642,6 +1642,12 @@ file(GLOB FAILING_FILES CONFIGURE_DEPENDS maxloc_bounds_5.f90 ptr_func_assign_1.f08 + # Tests looking for runtime errors (e.g., bound checks). Correctly + # caught by flang runtime, but not caught with Flang optimizations, + # e.g. due to intrinsics inlining. These can pass with -O0: + cshift_bounds_3.f90 + cshift_bounds_4.f90 + # Bad test, assigning an 11 elements array to a 12 elements array. transfer_array_intrinsic_4.f90