diff mbox

[Fortran] Fix PR 56224

Message ID 5115649D.4080808@netcologne.de
State New
Headers show

Commit Message

Thomas Koenig Feb. 8, 2013, 8:48 p.m. UTC
Hello world,

the attached patch fixes the PR by (re-)adding a search path
for the path used by intrinsic modules.

Regression-tested.  OK for trunk?

	Thomas

2013-02-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/56224
         * options.c (gfc_handle_option):  Also call
         gfc_add_include_path for intrinsic modules.

2013-02-08  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/56224
         * gfortran.dg/gomp/omp_lib_1.F:  New test.
         * gfortran.dg/gomp/omp_lib_2.f:  New test.

Comments

Paul Richard Thomas Feb. 9, 2013, 10:07 a.m. UTC | #1
It looks OK to me - is Jakub OK with it?

Cheers

Paul

On 8 February 2013 21:48, Thomas Koenig <tkoenig@netcologne.de> wrote:
> Hello world,
>
> the attached patch fixes the PR by (re-)adding a search path
> for the path used by intrinsic modules.
>
> Regression-tested.  OK for trunk?
>
>         Thomas
>
> 2013-02-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
>
>         PR fortran/56224
>         * options.c (gfc_handle_option):  Also call
>         gfc_add_include_path for intrinsic modules.
>
> 2013-02-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
>
>         PR fortran/56224
>         * gfortran.dg/gomp/omp_lib_1.F:  New test.
>         * gfortran.dg/gomp/omp_lib_2.f:  New test.
Tobias Burnus Feb. 9, 2013, 10:22 a.m. UTC | #2
Paul Richard Thomas wrote:
> It looks OK to me - is Jakub OK with it?
>
> On 8 February 2013 21:48, Thomas Koenig <tkoenig@netcologne.de> wrote:
>> the attached patch fixes the PR by (re-)adding a search path
>> for the path used by intrinsic modules.
>>
>> Regression-tested.  OK for trunk?

I am still recovering from a cold, but I have some questions:

Are you sure that the test case in gfortran.dg/gomp/omp_lib_1.F works? 
The OpenMP Fortran headers (and modules) are generated in libgomp/. 
Thus, I am not sure they are available in gcc/testsuite/gfortran.dg/gomp 
(in particular when the compiler is not installed).

+      /* FIXME:  This is needed because omp_lib.h is in a
+	 directory together with intrinsic modules.  */
+      gfc_add_include_path (arg, false, false);
+


Why did you put a FIXME there? What's wrong with adding the directory here?

And, as you re-add the "gfc_add_include_path", which you have removed in 
http://gcc.gnu.org/ml/fortran/2012-08/msg00013.html - What has changed 
to avoid the issues which lead to the patch in August patch, namely

"Seems to break testing, all testcases emit
Warning: Nonexistent include directory "finclude"^M"

I think those only occurred when the compiler is not installed. Will 
they pop up again?

Tobias

>> 2013-02-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
>>
>>          PR fortran/56224
>>          * options.c (gfc_handle_option):  Also call
>>          gfc_add_include_path for intrinsic modules.
>>
>> 2013-02-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
>>
>>          PR fortran/56224
>>          * gfortran.dg/gomp/omp_lib_1.F:  New test.
>>          * gfortran.dg/gomp/omp_lib_2.f:  New test.
Jakub Jelinek Feb. 9, 2013, 11:07 a.m. UTC | #3
On Sat, Feb 09, 2013 at 11:22:18AM +0100, Tobias Burnus wrote:
> Are you sure that the test case in gfortran.dg/gomp/omp_lib_1.F
> works? The OpenMP Fortran headers (and modules) are generated in
> libgomp/. Thus, I am not sure they are available in
> gcc/testsuite/gfortran.dg/gomp (in particular when the compiler is
> not installed).

gfortran.dg/gomp/ testsuite doesn't add the necessary paths to libgomp build
tree, only libgomp/testsuite/fortran/ does.  So I don't see how the
testcases can work, but I also don't see how this PR can be actually
testable in gcc's testsuite, the problem is only with installed compiler.

> "Seems to break testing, all testcases emit
> Warning: Nonexistent include directory "finclude"^M"

I don't remember ever seeing such failures.  But, perhaps
gcc/fortran/Make-lang.in can create (empty?) finclude/ directory in the
build tree, similarly to how stmp-int-hdrs goal in gcc/Makefile.in creates
include/ directory.  E.g. make fortran: goal dependent on a phony goal
that creates finclude/ directory if missing.

	Jakub
diff mbox

Patch

Index: options.c
===================================================================
--- options.c	(Revision 195686)
+++ options.c	(Arbeitskopie)
@@ -844,6 +844,11 @@  gfc_handle_option (size_t scode, const char *arg,
 
     case OPT_fintrinsic_modules_path:
     case OPT_fintrinsic_modules_path_:
+
+      /* FIXME:  This is needed because omp_lib.h is in a
+	 directory together with intrinsic modules.  */
+      gfc_add_include_path (arg, false, false);
+
       gfc_add_intrinsic_modules_path (arg);
       break;