aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2024-01-08 20:27:20 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2024-01-08 20:27:20 +0000
commit932b8d077c23986da5279bf8b5d84875de1fb826 (patch)
treea11b87e11e0510544cadd5b4979d30f9dbe2d62e
parentf9290cdf4697f467fd0fb7c710f58cc12e497889 (diff)
downloadgcc-932b8d077c23986da5279bf8b5d84875de1fb826.zip
gcc-932b8d077c23986da5279bf8b5d84875de1fb826.tar.gz
gcc-932b8d077c23986da5279bf8b5d84875de1fb826.tar.bz2
hppa: Fix bind_c_coms.f90 and bind_c_vars.f90 tests on hppa
Commit 6271dd98 changed the default from -fcommon to -fno-common. This silently changed the alignment of uninitialized BSS data on hppa where the alignment of common data must be greater or equal to the alignment of the largest type that will fit in the block. For example, the alignment of `double d[2];' changed from 16 to 8 on hppa64. The hppa architecture requires strict alignment and the linker warns about inconsistent alignment of variables. This change broke the gfortran.dg/bind_c_coms.f90 and gfortran.dg/bind_c_vars.f90 tests. These tests check whether bind_c works between fortran and C. Adding the -fcommon option fixes the tests. Probably, gcc and HP C are now by default inconsistent but that's water under the bridge. 2024-01-08 John David Anglin <danglin@gcc.gnu.org> gcc/testsuite/ChangeLog: PR testsuite/94253 * gfortran.dg/bind_c_coms.f90: Add -fcommon option on hppa*-*-*. * gfortran.dg/bind_c_vars.f90: Likewise.
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_coms.f901
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_vars.f901
2 files changed, 2 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/bind_c_coms.f90 b/gcc/testsuite/gfortran.dg/bind_c_coms.f90
index 85ead9f..2f97149 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_coms.f90
+++ b/gcc/testsuite/gfortran.dg/bind_c_coms.f90
@@ -3,6 +3,7 @@
! { dg-options "-w" }
! the -w option is to prevent the warning about long long ints
module bind_c_coms
+! { dg-additional-options "-fcommon" { target hppa*-*-hpux* } }
use, intrinsic :: iso_c_binding
implicit none
diff --git a/gcc/testsuite/gfortran.dg/bind_c_vars.f90 b/gcc/testsuite/gfortran.dg/bind_c_vars.f90
index 4f4a0cf..ede3ffd 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_vars.f90
+++ b/gcc/testsuite/gfortran.dg/bind_c_vars.f90
@@ -1,6 +1,7 @@
! { dg-do run }
! { dg-additional-sources bind_c_vars_driver.c }
module bind_c_vars
+! { dg-additional-options "-fcommon" { target hppa*-*-hpux* } }
use, intrinsic :: iso_c_binding
implicit none