public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran
@ 2012-11-29 20:31 anlauf at gmx dot de
  2012-11-29 20:32 ` [Bug fortran/55534] " anlauf at gmx dot de
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: anlauf at gmx dot de @ 2012-11-29 20:31 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

             Bug #: 55534
           Summary: -Wno-missing-include-dirs does not work with gfortran
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: anlauf@gmx.de


Hi,

a non-existent include directory generates a warning.
Unfortunate it cannot be suppressed by -Wno-missing-include-dirs:

% gfc-trunk -I/no/such/dir -Wno-missing-include-dirs xxx.f90
Warning: Nonexistent include directory "/no/such/dir"
f951: warning: command line option '-Wno-missing-include-dirs' is valid for
C/C++/ObjC/ObjC++ but not for Fortran [enabled by default]

It would be nice if this worked with Fortran.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
@ 2012-11-29 20:32 ` anlauf at gmx dot de
  2012-12-04 23:02 ` anlauf at gmx dot de
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gmx dot de @ 2012-11-29 20:32 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

Harald Anlauf <anlauf at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
  2012-11-29 20:32 ` [Bug fortran/55534] " anlauf at gmx dot de
@ 2012-12-04 23:02 ` anlauf at gmx dot de
  2012-12-05  9:29 ` burnus at gcc dot gnu.org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gmx dot de @ 2012-12-04 23:02 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #1 from Harald Anlauf <anlauf at gmx dot de> 2012-12-04 23:02:29 UTC ---
It would be nice if somebody could explain how to handle the
setting of options.

In the meantime, since this warning may generate lots of output,
I disabled it:

Index: gcc/fortran/scanner.c
===================================================================
--- gcc/fortran/scanner.c       (revision 194167)
+++ gcc/fortran/scanner.c       (working copy)
@@ -326,7 +326,7 @@
       else
        {
          /* FIXME:  Also support -Wmissing-include-dirs.  */
-         if (warn)
+         if (0)
            gfc_warning_now ("Nonexistent include directory \"%s\"", path);
        }
       return;


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
  2012-11-29 20:32 ` [Bug fortran/55534] " anlauf at gmx dot de
  2012-12-04 23:02 ` anlauf at gmx dot de
@ 2012-12-05  9:29 ` burnus at gcc dot gnu.org
  2012-12-05 21:44 ` anlauf at gmx dot de
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-12-05  9:29 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |tkoenig at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-05 09:29:08 UTC ---
(See PR 54033 for the patch which originally added this feature.)

Untested patch.

--- a/gcc/fortran/cpp.c
+++ b/gcc/fortran/cpp.c
@@ -471,2 +471,3 @@ gfc_cpp_post_options (void)
   cpp_option->preprocessed = gfc_option.flag_preprocessed;
+  cpp_option->warn_missing_include_dirs =
gfc_option.warn_missing_include_dirs;

diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index bf767b2..6f3515f 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2236,2 +2236,3 @@ typedef struct
   int warn_target_lifetime;
+  int warn_missing_include_dirs;
   int max_errors;
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index e05b935..489d1ff 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -117,2 +117,3 @@ gfc_init_options (unsigned int decoded_options_count,
   gfc_option.warn_target_lifetime = 0;
+  gfc_option.warn_missing_include_dirs = 0;
   gfc_option.max_errors = 25;
@@ -478,2 +485,3 @@ set_Wall (int setting)
   gfc_option.warn_target_lifetime = setting;
+  gfc_option.warn_missing_include_dirs = setting;

@@ -686,2 +694,6 @@ gfc_handle_option (size_t scode, const char *arg, int
value,

+    case OPT_Wmissing_include_dirs:
+      gfc_option.warn_missing_include_dirs = value;
+      break;
+
     case OPT_Wrealloc_lhs:
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 765c0f9..2bdd87f 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -327,4 +327,3 @@ add_path_to_list (gfc_directorylist **list, const char
*path,
        {
-         /* FIXME:  Also support -Wmissing-include-dirs.  */
-         if (warn)
+         if (warn && gfc_option.warn_missing_include_dirs)
            gfc_warning_now ("Nonexistent include directory \"%s\"", path);


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (2 preceding siblings ...)
  2012-12-05  9:29 ` burnus at gcc dot gnu.org
@ 2012-12-05 21:44 ` anlauf at gmx dot de
  2012-12-06  0:04 ` burnus at gcc dot gnu.org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gmx dot de @ 2012-12-05 21:44 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> 2012-12-05 21:43:43 UTC ---
(In reply to comment #2)
> (See PR 54033 for the patch which originally added this feature.)
> 
> Untested patch.

With this patch, the warning is also gone.  :-)

However, now using the option -Wmissing-include-dirs
yields the message:

f951: warning: command line option '-Wmissing-include-dirs' is valid for
C/C++/ObjC/ObjC++ but not for Fortran [enabled by default]

Which might not be intended, although I can live with it. :-)

I addition to the patch in comment #2 tried:

Index: gcc/fortran/lang.opt
===================================================================
--- gcc/fortran/lang.opt        (revision 194167)
+++ gcc/fortran/lang.opt        (working copy)
@@ -254,6 +254,10 @@
 Fortran Warning
 Warn on intrinsics not part of the selected standard

+Wmissing-include-dirs
+Fortran Warning
+; Documented in C
+
 Wreal-q-constant
 Fortran Warning
 Warn about real-literal-constants with 'q' exponent-letter


Now the above warning is gone, but some piece is still missing...


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (3 preceding siblings ...)
  2012-12-05 21:44 ` anlauf at gmx dot de
@ 2012-12-06  0:04 ` burnus at gcc dot gnu.org
  2012-12-07 21:10 ` anlauf at gmx dot de
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-12-06  0:04 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-06 00:04:34 UTC ---
(In reply to comment #3)
> I addition to the patch in comment #2 tried:

That piece I also had, but I forgot to include it in the diff. (I have too many
patches on that tree.


> Now the above warning is gone, but some piece is still missing...

* The "-I/foo/bar" might come before -Wno-missing-include-dirs in
gfc_handle_option; thus, the warning in add_path_to_list doesn't trigger.

* With the patch and the warning activated, the compiler crashes in
gcc/incpath.c's remove_duplicates for cur->name == "/no/such/dir".


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (4 preceding siblings ...)
  2012-12-06  0:04 ` burnus at gcc dot gnu.org
@ 2012-12-07 21:10 ` anlauf at gmx dot de
  2012-12-13 21:11 ` anlauf at gmx dot de
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gmx dot de @ 2012-12-07 21:10 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #5 from Harald Anlauf <anlauf at gmx dot de> 2012-12-07 21:09:50 UTC ---
(In reply to comment #4)
> * With the patch and the warning activated, the compiler crashes in
> gcc/incpath.c's remove_duplicates for cur->name == "/no/such/dir".

Yes, I get:

f951: internal compiler error: Aborted
0x85ec4b0 crash_signal
        ../../trunk/gcc/toplev.c:334
0x8b0e334 cpp_diagnostic
        ../../trunk/libcpp/errors.c:63

62  if (!pfile->cb.error)
63    abort ();
64  ret = pfile->cb.error (pfile, level, reason, src_loc, 0, _(msgid), ap);

The callback(?) cb.error is probably not set.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (5 preceding siblings ...)
  2012-12-07 21:10 ` anlauf at gmx dot de
@ 2012-12-13 21:11 ` anlauf at gmx dot de
  2014-09-09 21:39 ` manu at gcc dot gnu.org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gmx dot de @ 2012-12-13 21:11 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #6 from Harald Anlauf <anlauf at gmx dot de> 2012-12-13 21:11:20 UTC ---
Adding some prints, I found that the crash is probably due to
the actual order of invocation of some functions:

gfc_post_options, which calls gfc_cpp_post_options;
then gfc_cpp_register_include_paths, leading to the crash.

At this time, gfc_init was not yet called.

With -Wno-missing-include-dirs, the execution proceeds thru
gfc_init and then gfc_cpp_init_0, where the callbacks finally
are initialized.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (6 preceding siblings ...)
  2012-12-13 21:11 ` anlauf at gmx dot de
@ 2014-09-09 21:39 ` manu at gcc dot gnu.org
  2014-12-29 20:00 ` anlauf at gmx dot de
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: manu at gcc dot gnu.org @ 2014-09-09 21:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-09-09
                 CC|                            |manu at gcc dot gnu.org
         Depends on|                            |62226
     Ever confirmed|0                           |1

--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
The ideal fix for this would adding a function like:

+bool
+gfc_warning_cmdline (int opt, const char *gmsgid, ...)
+{
+  va_list argp;
+  diagnostic_info diagnostic;
+  bool ret;
+
+  va_start (argp, gmsgid);
+  diagnostic_set_info (&diagnostic, gmsgid, &argp, UNKNOWN_LOCATION,
+                      DK_WARNING);
+  diagnostic.option_index = opt;
+  ret = report_diagnostic (&diagnostic);
+  va_end (argp);
+  return ret;
+}
+

in error.c. Then calling:

Index: gcc/fortran/scanner.c
===================================================================
--- gcc/fortran/scanner.c       (revision 214251)
+++ gcc/fortran/scanner.c       (working copy)
@@ -326,13 +326,13 @@ add_path_to_list (gfc_directorylist **li
       if (errno != ENOENT)
        gfc_warning_now ("Include directory \"%s\": %s", path,
                         xstrerror(errno));
       else
        {
-         /* FIXME:  Also support -Wmissing-include-dirs.  */
          if (warn)
-           gfc_warning_now ("Nonexistent include directory \"%s\"", path);
+           gfc_warning_cmdline (OPT_Wmissing_include_dirs,
+                                "Nonexistent include directory \"%s\"", path);
        }
       return;
     }
   else if (!S_ISDIR (st.st_mode))
     {

Then, NOT adding gfc_option.warn_missing_include_dirs, but instead fixing
62226, and simply adding:

Index: gcc/fortran/lang.opt
===================================================================
--- gcc/fortran/lang.opt        (revision 194167)
+++ gcc/fortran/lang.opt        (working copy)
@@ -254,6 +254,10 @@
 Fortran Warning
 Warn on intrinsics not part of the selected standard

+Wmissing-include-dirs
+Fortran Warning
+; Documented in C
+
 Wreal-q-constant
 Fortran Warning
 Warn about real-literal-constants with 'q' exponent-letter

This automatically will give you:

* Setting cpp_opts, even when using #pragma, -Werror= and complicated
combinations.

* Colors!

* Printing [-Wmissing-include-dirs] in the warning message.
>From gcc-bugs-return-461516-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 09 21:47:35 2014
Return-Path: <gcc-bugs-return-461516-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16520 invoked by alias); 9 Sep 2014 21:47:35 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 16489 invoked by uid 48); 9 Sep 2014 21:47:31 -0000
From: "carrot at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/63156] web can't handle AUTOINC correctly
Date: Tue, 09 Sep 2014 21:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: carrot at google dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: steven at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-63156-4-me4WZz2sj7@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63156-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63156-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-09/txt/msg01350.txt.bz2
Content-length: 684

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc156

--- Comment #9 from Carrot <carrot at google dot com> ---
The original flag setting code is neither correct. Consider following
pre_modify expression:

(pre_modify (r1)                // def1, use1
            (plus (r1)          // use2
                  (r2)))        // use3

GCC will generate 4 df_ref information for this expression as noted, 1 def and
3 use. Current code only set DF_REF_READ_WRITE for def1, this causes web do
wrong renaming. The original flag setting code will set DF_REF_READ_WRITE for
all def/use in this expression, this is obviously wrong for r2.

I don't know if this has any relations to bug 32339.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (7 preceding siblings ...)
  2014-09-09 21:39 ` manu at gcc dot gnu.org
@ 2014-12-29 20:00 ` anlauf at gmx dot de
  2014-12-29 21:28 ` manu at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: anlauf at gmx dot de @ 2014-12-29 20:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #9 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Manuel López-Ibáñez from comment #8)
> (In reply to Manuel López-Ibáñez from comment #7)
> > The ideal fix for this would adding a function like:
> 
> I forgot about this bug and redid the above from scratch. But this time, I
> actually tested that it works:
> https://gcc.gnu.org/ml/fortran/2014-10/msg00019.html

Has this patch been applied?

I checked r219084.  The bug is still there:

% gfc-trunk -Wno-missing-include-dirs xxx.f90 -I /no/such/dir
f951: Warning: Nonexistent include directory '/no/such/dir'
[-Wmissing-include-dirs]

At least I now see the colors...
>From gcc-bugs-return-471900-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 29 20:32:12 2014
Return-Path: <gcc-bugs-return-471900-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7822 invoked by alias); 29 Dec 2014 20:32:11 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 7772 invoked by uid 48); 29 Dec 2014 20:32:07 -0000
From: "iverbin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/64412] [regression] ICE in offload compiler: in extract_insn, at recog.c:2327
Date: Mon, 29 Dec 2014 20:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: iverbin at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-64412-4-IcncXEb9y8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64412-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64412-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-12/txt/msg02907.txt.bz2
Content-length: 362

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd412

--- Comment #9 from iverbin at gcc dot gnu.org ---
(In reply to H.J. Lu from comment #8)
> Created attachment 34357 [details]
> A patch
>
> Can you try this?

Thank you, e.53.5.c now passed.

However for-3.c and for-11.C still fails with another unrecognizable insn. I
attached reduced testcase (pr64412_2).


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (8 preceding siblings ...)
  2014-12-29 20:00 ` anlauf at gmx dot de
@ 2014-12-29 21:28 ` manu at gcc dot gnu.org
  2021-09-17  9:42 ` burnus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: manu at gcc dot gnu.org @ 2014-12-29 21:28 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4599 bytes --]

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #10 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Harald Anlauf from comment #9)
> (In reply to Manuel López-Ibáñez from comment #8)
> > (In reply to Manuel López-Ibáñez from comment #7)
> > > The ideal fix for this would adding a function like:
> > 
> > I forgot about this bug and redid the above from scratch. But this time, I
> > actually tested that it works:
> > https://gcc.gnu.org/ml/fortran/2014-10/msg00019.html
> 
> Has this patch been applied?

An equivalent one has. The remaining problem (I think) is that the warning is
given when -I is processed, so the order of -I and -Wno-missing-include-dirs
matters. In your example, the order should be correct, but the driver
unhelpfully re-orders the command-line as:

f951 xxx.f90 -I /no/such/dir -quiet -dumpbase xxx.f90 "-mtune=generic"
"-march=x86-64" -auxbase xxx -Wno-missing-include-dirs -fintrinsic-modules-path
finclude -o /tmp/ccwz8Va5.s

If I invoke f951 manually, it works:

f951 -Wno-missing-include-dirs ~/xxx.f90 -I /no/such/dir
-Wno-missing-include-dirs

However, if I invoke it like this it doesn't work:

f951 -Wno-missing-include-dirs ~/xxx.f90 -I /no/such/dir
-Wno-missing-include-dirs

because prune_options removes duplicated options by keeping the last one.

Thus, the fix is either to buffer the arguments to -I and process them after
all options have been processed or move just the warning code to such a latter
phase. I'm not sure what is simpler.

This is what the C/C++ FE does (see incpath.c add_path, which is called when -I
is processed and c-opts.c register_include_chains, which is called after
options processing and gives the diagnostics).

Note that this applies to all warnings given by add_path_to_list, since ideally
they should be disabled by "--no-warnings" (aka -w), but currently it depends
on the order they are given.
>From gcc-bugs-return-471907-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 29 21:42:44 2014
Return-Path: <gcc-bugs-return-471907-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7007 invoked by alias); 29 Dec 2014 21:42:43 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 6996 invoked by uid 89); 29 Dec 2014 21:42:43 -0000
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=4.0 required=5.0 testsºYES_99,BAYES_999,FILL_THIS_FORM_FRAUD_PHISH,RCVD_IN_DNSWL_NONE,SPF_FAIL,T_FILL_THIS_FORM_SHORT autolearn=no version=3.3.2
X-HELO: sg2nlvphout03.shr.prod.sin2.secureserver.net
Received: from sg2nlvphout03.shr.prod.sin2.secureserver.net (HELO sg2nlvphout03.shr.prod.sin2.secureserver.net) (182.50.132.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Dec 2014 21:42:42 +0000
Received: from vedaserver ([118.139.182.196])	by sg2nlvphout03.shr.prod.sin2.secureserver.net with : DED :	id ZZid1p02J4Ef9Kq01ZieEW; Mon, 29 Dec 2014 14:42:38 -0700
MIME-Version: 1.0
From: "Anushka ISMS" <anushka@ismsedu.com>
Reply-To: anushka@ismsedu.com
To: gcc-bugs@gcc.gnu.org
Subject: Opportunity Never Wait for Anybody : New Session Announcement For Distance Learning Courses
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Date: Mon, 29 Dec 2014 21:42:00 -0000
Message-ID: <2164207878536797320837@vedaserver>
X-SW-Source: 2014-12/txt/msg02914.txt.bz2
Content-length: 767

Get MBA, E-MBA , MMS, DMS, PGDBM ,DBM etc done without disturbing your job... Any Certificate NO Donation / Percentage Barrier

International Attestations by Ministry of External Affairs and Foreign Affairs (Charges apply*)

GIVE US AN OPPORTUNITY TO MAKE YOUR CAREER:

Please reply to this mail providing following details to obtain detail information about our Institute, Course, Exams etc.

Name:

Contact No.:

Email id :

Course of Interest:

Specialization:

Query:

Qualifications & Work Experience :

Address Details:

When you're ready to make the time, my help is just a phone call or e-mail away.

With your success in mind,

For ISMS

Indian School of Management & Studies,

Anushka ISMS

Email :- anushka@ismsedu.com

Website :- www.ismsedu.com


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (9 preceding siblings ...)
  2014-12-29 21:28 ` manu at gcc dot gnu.org
@ 2021-09-17  9:42 ` burnus at gcc dot gnu.org
  2021-09-17 13:02 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-09-17  9:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The problem is an ordering problem.


Namely:

* toplev.c calls:
  lang_hooks.init_options (save_decoded_options_count, save_decoded_options);

which in turn is:

gfc_init_options ( ....
{
  ...
  SET_OPTION_IF_UNSET (&global_options, &global_options_set,
                       cpp_warn_missing_include_dirs, 1);
...
  /* Initialize cpp-related options.  */
  gfc_cpp_init_options (decoded_options_count, decoded_options);
...
}

Thus, cpp_warn_missing_include_dirs is enabled.


Now:
  decode_options (&global_options, &global_options_set, ...
is run, which calls:
  read_cmdline_options (opts, opts_set, ...
  → read_cmdline_option
    → handle_option
      → gfc_handle_option
        → gfc_add_include_path
          → gfc_warning_now

and only afterwards decode_options invokes:
  set_option (...)
which then sets:
  global_options_set->x_... = 1
and
  global_options->x_...  = commandline option.
and disables the already shown warning.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (10 preceding siblings ...)
  2021-09-17  9:42 ` burnus at gcc dot gnu.org
@ 2021-09-17 13:02 ` burnus at gcc dot gnu.org
  2021-09-21  6:28 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-09-17 13:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #12 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579678.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (11 preceding siblings ...)
  2021-09-17 13:02 ` burnus at gcc dot gnu.org
@ 2021-09-21  6:28 ` cvs-commit at gcc dot gnu.org
  2021-09-21  7:13 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-21  6:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:417ea5c02cef7f000e66d1af22b066c2c1cda047

commit r12-3722-g417ea5c02cef7f000e66d1af22b066c2c1cda047
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Tue Sep 21 08:27:00 2021 +0200

    Fortran: Fix -Wno-missing-include-dirs handling [PR55534]

    gcc/fortran/ChangeLog:

            PR fortran/55534
            * cpp.c: Define GCC_C_COMMON_C for #include "options.h" to make
            cpp_reason_option_codes available.
            (gfc_cpp_register_include_paths): Make static, set pfile's
            warn_missing_include_dirs and move before caller.
            (gfc_cpp_init_cb): New, cb code moved from ...
            (gfc_cpp_init_0): ... here.
            (gfc_cpp_post_options): Call gfc_cpp_init_cb.
            (cb_cpp_diagnostic_cpp_option): New. As implemented in c-family
            to match CppReason flags to -W... names.
            (cb_cpp_diagnostic): Use it to replace single special case.
            * cpp.h (gfc_cpp_register_include_paths): Remove as now static.
            * gfortran.h (gfc_check_include_dirs): New prototype.
            (gfc_add_include_path): Add new bool arg.
            * options.c (gfc_init_options): Don't set -Wmissing-include-dirs.
            (gfc_post_options): Set it here after commandline processing. Call
            gfc_add_include_path with defer_warn=false.
            (gfc_handle_option): Call it with defer_warn=true.
            * scanner.c (gfc_do_check_include_dir, gfc_do_check_include_dirs,
            gfc_check_include_dirs): New. Diagnostic moved from ...
            (add_path_to_list): ... here, which came before cmdline processing.
            Take additional bool defer_warn argument.
            (gfc_add_include_path): Take additional defer_warn arg.
            * scanner.h (struct gfc_directorylist): Reorder for alignment
issues,
            add new 'bool warn'.

    libgfortran/ChangeLog:
            PR fortran/55534
            * configure.ac (AM_FCFLAGS): Add -Wno-missing-include-dirs.
            * configure: Regenerate.

    libgomp/ChangeLog:
            PR fortran/55534
            * testsuite/libgomp.fortran/fortran.exp: Add
-Wno-missing-include-dirs
            to ALWAYS_CFLAGS.
            * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.

    gcc/testsuite/ChangeLog:
            * gfortran.dg/include_6.f90: Change dg-error to
            dg-warning and update pattern.
            * gfortran.dg/include_14.f90: New test.
            * gfortran.dg/include_15.f90: New test.
            * gfortran.dg/include_16.f90: New test.
            * gfortran.dg/include_17.f90: New test.
            * gfortran.dg/include_18.f90: New test.
            * gfortran.dg/include_19.f90: New test.
            * gfortran.dg/include_20.f90: New test.
            * gfortran.dg/include_21.f90: New test.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (12 preceding siblings ...)
  2021-09-21  6:28 ` cvs-commit at gcc dot gnu.org
@ 2021-09-21  7:13 ` burnus at gcc dot gnu.org
  2021-09-22 18:58 ` cvs-commit at gcc dot gnu.org
  2021-09-24  7:31 ` cvs-commit at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-09-21  7:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #14 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Finally FIXED after 9 years.

Thanks for report + the review Harald.
Thanks to all for the patience.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (13 preceding siblings ...)
  2021-09-21  7:13 ` burnus at gcc dot gnu.org
@ 2021-09-22 18:58 ` cvs-commit at gcc dot gnu.org
  2021-09-24  7:31 ` cvs-commit at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-22 18:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:83aac698835edcdb3e6d96b856bef1c5f92e5e24

commit r12-3825-g83aac698835edcdb3e6d96b856bef1c5f92e5e24
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Wed Sep 22 20:58:35 2021 +0200

    Fortran: Improve -Wmissing-include-dirs warnings [PR55534]

    It turned out that enabling the -Wmissing-include-dirs for libcpp did
output
    too many warnings â at least as run with -B and similar options during
the
    GCC build and warning for internal include dirs like finclude, unlikely of
    relevance to for a real-world user.
    This patch now only warns for -I and -J by default but permits to get the
    full warnings including libcpp ones with -Wmissing-include-dirs. It
    additionally documents this in the manual.

    With that change, the -Wno-missing-include-dirs could be removed
    from libgfortran's configure and libgomp's testsuite always cflags.
    This reverts those bits of the previous
    commit r12-3722-g417ea5c02cef7f000e66d1af22b066c2c1cda047

    Additionally, it turned out that all call to load_file called exit
    explicitly - except for the main file via gfc_init -> gfc_new_file. The
    latter also output a file not existing fatal error, such that two errors
    where printed. Now exit is called in line with the other users of
    load_file.

    Finally, when compileing with "nonexisting/file.f90", first a warning that
    "nonexisting" does not exist as include path was printed before the file
    not found error was printed. Now the directory in which the physical file
    is located is added silently, relying on the file-not-found diagnostic for
    those.

            PR fortran/55534
    gcc/ChangeLog:

            * doc/invoke.texi (-Wno-missing-include-dirs.): Document Fortran
            behavior.

    gcc/fortran/ChangeLog:

            * cpp.c (gfc_cpp_register_include_paths, gfc_cpp_post_options):
            Add new bool verbose_missing_dir_warn argument.
            * cpp.h (gfc_cpp_post_options): Update prototype.
            * f95-lang.c (gfc_init): Remove duplicated file-not found diag.
            * gfortran.h (gfc_check_include_dirs): Takes bool
            verbose_missing_dir_warn arg.
            (gfc_new_file): Returns now void.
            * options.c (gfc_post_options): Update to warn for -I and -J,
            only, by default but for all when user requested.
            * scanner.c (gfc_do_check_include_dir):
            (gfc_do_check_include_dirs, gfc_check_include_dirs): Take bool
            verbose warn arg and update to avoid printing the same message
            twice or never.
            (load_file): Fix indent.
            (gfc_new_file): Return void and exit when load_file failed
            as all other load_file users do.

    libgfortran/ChangeLog:

            * configure.ac (AM_FCFLAGS): Revert r12-3722 by removing
            -Wno-missing-include-dirs.
            * configure: Regenerate.

    libgomp/ChangeLog:

            * testsuite/libgomp.fortran/fortran.exp (ALWAYS_CFLAGS): Revert
            r12-3722 by removing -Wno-missing-include-dirs.
            * testsuite/libgomp.oacc-fortran/fortran.exp (ALWAYS_CFLAGS):
Likewise.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/include_14.f90: Add -J testcase and update dg-output.
            * gfortran.dg/include_15.f90: Likewise.
            * gfortran.dg/include_16.f90: Likewise.
            * gfortran.dg/include_17.f90: Likewise.
            * gfortran.dg/include_18.f90: Likewise.
            * gfortran.dg/include_19.f90: Likewise.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug fortran/55534] -Wno-missing-include-dirs does not work with gfortran
  2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
                   ` (14 preceding siblings ...)
  2021-09-22 18:58 ` cvs-commit at gcc dot gnu.org
@ 2021-09-24  7:31 ` cvs-commit at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-24  7:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:204f56aa65d2496e9f7db86c4aa37d42a336fc5b

commit r12-3877-g204f56aa65d2496e9f7db86c4aa37d42a336fc5b
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Sep 24 09:30:51 2021 +0200

    Fortran: Improve file-reading error diagnostic [PR55534]

            PR fortran/55534

    gcc/fortran/ChangeLog:

            * scanner.c (load_file): Return void, call (gfc_)fatal_error for
            all errors.
            (include_line, include_stmt, gfc_new_file): Remove exit call
            for failed load_file run.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/include_9.f90: Add dg-prune-output.
            * gfortran.dg/include_23.f90: New test.
            * gfortran.dg/include_24.f90: New test.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-09-24  7:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-29 20:31 [Bug fortran/55534] New: -Wno-missing-include-dirs does not work with gfortran anlauf at gmx dot de
2012-11-29 20:32 ` [Bug fortran/55534] " anlauf at gmx dot de
2012-12-04 23:02 ` anlauf at gmx dot de
2012-12-05  9:29 ` burnus at gcc dot gnu.org
2012-12-05 21:44 ` anlauf at gmx dot de
2012-12-06  0:04 ` burnus at gcc dot gnu.org
2012-12-07 21:10 ` anlauf at gmx dot de
2012-12-13 21:11 ` anlauf at gmx dot de
2014-09-09 21:39 ` manu at gcc dot gnu.org
2014-12-29 20:00 ` anlauf at gmx dot de
2014-12-29 21:28 ` manu at gcc dot gnu.org
2021-09-17  9:42 ` burnus at gcc dot gnu.org
2021-09-17 13:02 ` burnus at gcc dot gnu.org
2021-09-21  6:28 ` cvs-commit at gcc dot gnu.org
2021-09-21  7:13 ` burnus at gcc dot gnu.org
2021-09-22 18:58 ` cvs-commit at gcc dot gnu.org
2021-09-24  7:31 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).