This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, F08] PR 84313: reject procedure pointers in COMMON blocks
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Richard Guenther <rguenther at suse dot de>
- Date: Wed, 14 Feb 2018 16:57:54 +0100
- Subject: Re: [Patch, Fortran, F08] PR 84313: reject procedure pointers in COMMON blocks
- Authentication-results: sourceware.org; auth=none
- References: <CAKwh3qhbdSontmz3XmNO9r9ec4OUfod+hk9U-k57Sv-o009Uvw@mail.gmail.com> <20180214113014.GW5867@tucnak> <20180214114757.GB5866@tucnak> <CAKwh3qhzo1FrzUvFMavzkEZ8tHHYBw=+PjrAWrYWnQoQCp0PEg@mail.gmail.com>
>>> Adding ! { dg-additional-options "-std=f2003" }
>>> doesn't work, because the test uses
>>> call abort
>
> I actually think we should get rid of such extensions in the
> testsuite, where possible. This particular one is used all over the
> place, but could be easily replaces by something like "stop 1", which
> is standard Fortran.
Just opened a PR for this:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84381
>>> which is a GNU extension and I have no idea how to choose allow_std
>>> which includes GNU but doesn't include F2008.
>>
>> ! { dg-additional-options "-std=f2003 -fdec" }
>>
>> seems to work (because -std=f2003 sets
>> gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77
>> | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008_OBS;
>> and -fdec adds:
>> gfc_option.allow_std |= GFC_STD_F95_OBS | GFC_STD_F95_DEL
>> | GFC_STD_GNU | GFC_STD_LEGACY;
>> ), but it is quite nasty. Isn't there a better way?
>
> Yes, there is "-std=f2003 -fall-intrinsics", which is a little better
> at least. It's what I did with proc_ptr_common1.f90 as well ...
>
> https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/testsuite/gfortran.dg/proc_ptr_common_1.f90?r1=257636&r2=257635&pathrev=257636
Thanks for taking care of fixing this so quickly, Jakub (and for
noticing it in the first place)!
>> Kind like -std=gnu++17 vs. -std=c++17 where the latter is standard
>> and former standard + GNU extensions (which would roughly be
>> "| GFC_STD_GNU | GFC_STD_LEGACY" in the fortran world).
>
> Huh, I suppose it would be nice to have options like -std=gnu2003 and
> -std=gnu2008, in analogy to those C++ options ...
This is now:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84382
Cheers,
Janus