aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2013-02-14 22:13:26 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2013-02-14 22:13:26 +0000
commit308f961b9b2e0566894673f3b9d51e37a8e33606 (patch)
treeb7448e76189c5ab9dda84e7e0e477eace20755e4 /gcc/fortran
parentbb3accfa6fd67cb6f61d06c3cce1805754d28666 (diff)
downloadgcc-308f961b9b2e0566894673f3b9d51e37a8e33606.zip
gcc-308f961b9b2e0566894673f3b9d51e37a8e33606.tar.gz
gcc-308f961b9b2e0566894673f3b9d51e37a8e33606.tar.bz2
re PR fortran/56224 (gfortran -fopenmp cannot find omp_lib.h)
2013-02-14 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/56224 * gfortran.h (gfc_add_include_path): Add boolean argument for warn. * scanner.c (gfc_add_include_path): Pass along warn argument to add_path_to_list. * options.c (gfc_post_options): Add true warn argument to gfc_add_include_path. (gfc_handle_module_path_options): Likewise. (gfc_handle_option): Also gfc_add_include_path for intrinsic modules, without warning. From-SVN: r196058
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog13
-rw-r--r--gcc/fortran/gfortran.h2
-rw-r--r--gcc/fortran/options.c15
-rw-r--r--gcc/fortran/scanner.c5
4 files changed, 28 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3e9e791..1375d0e 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,16 @@
+2013-02-14 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/56224
+ * gfortran.h (gfc_add_include_path): Add boolean argument
+ for warn.
+ * scanner.c (gfc_add_include_path): Pass along warn argument
+ to add_path_to_list.
+ * options.c (gfc_post_options): Add true warn argument to
+ gfc_add_include_path.
+ (gfc_handle_module_path_options): Likewise.
+ (gfc_handle_option): Also gfc_add_include_path for intrinsic
+ modules, without warning.
+
2013-02-14 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 3b4b473..44d5c91 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2381,7 +2381,7 @@ match gfc_match_char_spec (gfc_typespec *);
void gfc_scanner_done_1 (void);
void gfc_scanner_init_1 (void);
-void gfc_add_include_path (const char *, bool, bool);
+void gfc_add_include_path (const char *, bool, bool, bool);
void gfc_add_intrinsic_modules_path (const char *);
void gfc_release_include_path (void);
FILE *gfc_open_included_file (const char *, bool, bool);
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index a014634..fba1a3f 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -337,10 +337,10 @@ gfc_post_options (const char **pfilename)
source_path = (char *) alloca (i + 1);
memcpy (source_path, canon_source_file, i);
source_path[i] = 0;
- gfc_add_include_path (source_path, true, true);
+ gfc_add_include_path (source_path, true, true, true);
}
else
- gfc_add_include_path (".", true, true);
+ gfc_add_include_path (".", true, true, true);
if (canon_source_file != gfc_source_file)
free (CONST_CAST (char *, canon_source_file));
@@ -498,7 +498,7 @@ gfc_handle_module_path_options (const char *arg)
gfc_option.module_dir = XCNEWVEC (char, strlen (arg) + 2);
strcpy (gfc_option.module_dir, arg);
- gfc_add_include_path (gfc_option.module_dir, true, false);
+ gfc_add_include_path (gfc_option.module_dir, true, false, true);
strcat (gfc_option.module_dir, "/");
}
@@ -844,6 +844,13 @@ gfc_handle_option (size_t scode, const char *arg, int value,
case OPT_fintrinsic_modules_path:
case OPT_fintrinsic_modules_path_:
+
+ /* This is needed because omp_lib.h is in a directory together
+ with intrinsic modules. Do no warn because during testing
+ without an installed compiler, we would get lots of bogus
+ warnings for a missing include directory. */
+ gfc_add_include_path (arg, false, false, false);
+
gfc_add_intrinsic_modules_path (arg);
break;
@@ -978,7 +985,7 @@ gfc_handle_option (size_t scode, const char *arg, int value,
break;
case OPT_I:
- gfc_add_include_path (arg, true, false);
+ gfc_add_include_path (arg, true, false, true);
break;
case OPT_J:
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 0467f8a..f714ed0 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -375,9 +375,10 @@ add_path_to_list (gfc_directorylist **list, const char *path,
void
-gfc_add_include_path (const char *path, bool use_for_modules, bool file_dir)
+gfc_add_include_path (const char *path, bool use_for_modules, bool file_dir,
+ bool warn)
{
- add_path_to_list (&include_dirs, path, use_for_modules, file_dir, true);
+ add_path_to_list (&include_dirs, path, use_for_modules, file_dir, warn);
/* For '#include "..."' these directories are automatically searched. */
if (!file_dir)