This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR fortran/87919 patch for -fno-dec-structure
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Mark Eggleston <mark dot eggleston at codethink dot co dot uk>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Beth White <beth dot white at codethink dot co dot uk>, Emmet Hikory <emmet dot hikory at codethink dot co dot uk>, Jeff Law <law at redhat dot com>
- Date: Wed, 7 Nov 2018 16:22:16 +0100
- Subject: Re: PR fortran/87919 patch for -fno-dec-structure
- References: <686ba917-27d4-451b-a0de-b28074166f2c@codethink.co.uk>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Nov 07, 2018 at 03:07:04PM +0000, Mark Eggleston wrote:
> PR fortran/87919
> * options.c (gfc_handle_option): Removed case OPT_fdec_structure
> as it breaks the handling of -fno-dec-structure.
No entries for the tests, i.e.
* gfortran.dg/pr87919-dec-structure-1.f: New test.
* gfortran.dg/pr87919-dec-structure-2.f: New test.
* gfortran.dg/pr87919-dec-structure-3.f: New test.
* gfortran.dg/pr87919-dec-structure-4.f: New test.
> diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
> index 73f5389361d9..3b7c2d40fe8a 100644
> --- a/gcc/fortran/options.c
> +++ b/gcc/fortran/options.c
> @@ -761,10 +761,6 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
> /* Enable all DEC extensions. */
> set_dec_flags (1);
> break;
> -
> - case OPT_fdec_structure:
> - flag_dec_structure = 1;
> - break;
> }
>
> Fortran_handle_option_auto (&global_options, &global_options_set,
LGTM, but I'll defer the final review to Fortran maintainers.
> diff --git a/gcc/testsuite/gfortran.dg/pr87919-dec-structure-1.f b/gcc/testsuite/gfortran.dg/pr87919-dec-structure-1.f
> new file mode 100644
> index 000000000000..4dd34082b97a
> --- /dev/null
> +++ b/gcc/testsuite/gfortran.dg/pr87919-dec-structure-1.f
> @@ -0,0 +1,21 @@
> +! { dg-do compile }
> +!
> +! PR/fortran/87919
Without the first /, i.e.
! PR fortran/87919
(in all tests).
> +++ b/gcc/testsuite/gfortran.dg/pr87919-dec-structure-2.f
> @@ -0,0 +1,22 @@
> +! { dg-do run }
> +! { dg-options "-fdec" }
> +!
> +! PR/fortran/87919
> +!
> +! Should compile anf run with the -fdec option
s/anf/and/ (in several tests).
> --- /dev/null
> +++ b/gcc/testsuite/gfortran.dg/pr87919-dec-structure-3.f
> @@ -0,0 +1,22 @@
> +! { dg-do run }
> +! { dg-options "-fdec-structure" }
> +!
> +! PR/fortran/87919
> +!
> +! Should compile anf run with the -fdec option
s/-fdec/-fdec-structure/ in this case.
> --- /dev/null
> +++ b/gcc/testsuite/gfortran.dg/pr87919-dec-structure-4.f
> @@ -0,0 +1,22 @@
> +! { dg-do compile }
> +! { dg-options "-fdec -fno-dec-structure" }
> +!
> +! PR/fortran/87919
> +!
> +! Should fail to compile with the -fdec and -fno-dec-structure option
s/option/options/
I'd suggest to add another test, with
! { dg-options "-fdec-structure -fno-dec-structure" }
where the options cancel each other and the result is no DEC structure
support.
Jakub