From 1e4c40729a2606b0b3cd7993d9f6faac7ca1506b Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 31 Oct 2007 16:10:12 +0100 Subject: [PATCH] [multiple changes] 2007-10-31 Tobias Burnus PR fortran/33941 * modules.c (intrinsics): Use only alphabetic names for intrinsic operators. 2007-10-31 Dominique d'Humieres Tobias Burnus PR fortran/33941 * gfortran.dg/module_read_1.f90: New. From-SVN: r129801 --- gcc/fortran/ChangeLog | 6 +++++ gcc/fortran/module.c | 12 ++++----- gcc/testsuite/ChangeLog | 6 +++++ gcc/testsuite/gfortran.dg/module_read_1.f90 | 29 +++++++++++++++++++++ 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/module_read_1.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 96e7a73c884..71c8d54c0c0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-10-31 Tobias Burnus + + PR fortran/33941 + * modules.c (intrinsics): Use only alphabetic names for + intrinsic operators. + 2007-10-31 Jerry DeLisle PR fortran/33162 diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 12c451697df..a05437adf93 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -2627,17 +2627,17 @@ static const mstring intrinsics[] = minit ("OR", INTRINSIC_OR), minit ("EQV", INTRINSIC_EQV), minit ("NEQV", INTRINSIC_NEQV), - minit ("==", INTRINSIC_EQ), + minit ("EQ_SIGN", INTRINSIC_EQ), minit ("EQ", INTRINSIC_EQ_OS), - minit ("/=", INTRINSIC_NE), + minit ("NE_SIGN", INTRINSIC_NE), minit ("NE", INTRINSIC_NE_OS), - minit (">", INTRINSIC_GT), + minit ("GT_SIGN", INTRINSIC_GT), minit ("GT", INTRINSIC_GT_OS), - minit (">=", INTRINSIC_GE), + minit ("GE_SIGN", INTRINSIC_GE), minit ("GE", INTRINSIC_GE_OS), - minit ("<", INTRINSIC_LT), + minit ("LT_SIGN", INTRINSIC_LT), minit ("LT", INTRINSIC_LT_OS), - minit ("<=", INTRINSIC_LE), + minit ("LE_SIGN", INTRINSIC_LE), minit ("LE", INTRINSIC_LE_OS), minit ("NOT", INTRINSIC_NOT), minit ("PARENTHESES", INTRINSIC_PARENTHESES), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 46dcd8ff808..9ff71b51f2c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-10-31 Dominique d'Humieres + Tobias Burnus + + PR fortran/33941 + * gfortran.dg/module_read_1.f90: New. + 2007-10-31 Tom Tromey PR preprocessor/30786: diff --git a/gcc/testsuite/gfortran.dg/module_read_1.f90 b/gcc/testsuite/gfortran.dg/module_read_1.f90 new file mode 100644 index 00000000000..9a680a62f3e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/module_read_1.f90 @@ -0,0 +1,29 @@ +! { dg-do run } +! PR fortran/33941 +! The problem was that the intrinsic operators +! were written to the module file as '/=' etc. +! but this format was not understood on reading. +! +! Test case by Toby White, stripped down by +! Dominique d'Humieres and Francois-Xavier Coudert + +module foo +contains + function pop(n) result(item) + integer :: n + character(len=merge(1, 0, n > 0)) :: item + end function pop + function push(n) result(item) + integer :: n + character(len=merge(1, 0, n /= 0)) :: item + end function push +end module foo + +program test + use foo + if(len(pop(0)) /= 0) call abort() + if(len(pop(1)) /= 1) call abort() + if(len(push(0)) /= 0) call abort() + if(len(push(1)) /= 1) call abort() +end program +! { dg-final { cleanup-modules "foo" } } -- 2.30.2