public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used
@ 2011-01-27  8:35 thenlich at users dot sourceforge.net
  2011-01-27  9:16 ` [Bug fortran/47486] " burnus at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-01-27  8:35 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: gfortran -M exits with fatal error when -o option is
                    used
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thenlich@users.sourceforge.net


When "-o file" is specified, the command exits with an error.

Example test.for:
      program test
      print "(a)", "hello world"
      end program

$ gfortran -cpp -M test.for -o test.d
Fatal Error: output filename specified twice

Expected action:
Write dependency to test.d

Version: gcc version 4.6.0 20110122 (experimental) (GCC)
Platform: i686-pc-mingw32


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

* [Bug fortran/47486] gfortran -M exits with fatal error when -o option is used
  2011-01-27  8:35 [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used thenlich at users dot sourceforge.net
@ 2011-01-27  9:16 ` burnus at gcc dot gnu.org
  2012-02-14 20:18 ` ktietz at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-01-27  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-27 08:31:56 UTC ---
In the compiler, the file name is handled in cpp.c via
gfc_cpp_option.output_filename -- but that part looks OK.

It seems to be a driver problem as the driver passes:
.../x86_64-unknown-linux-gnu/4.6.0/f951 ... -o test.d ... -o /tmp/cckDPYJ6.s

Thus, either a rule in lang-specs.h is wrong/missing or the problem is in
gfortranspec.c.

I think something like:   %{!o*:-o %b.s}  is missing and %b.s allways is
implicitly used.

Maybe %(cpp_unique_options) should be used? Currently, lang-specs.h contains
the following:

/* Identical to gcc.c (cpp_options), but omitting %(cpp_unique_options)
   and -fpch-preprocess on -save-temps.  */
#define CPP_ONLY_OPTIONS    "%1 %{m*} %{f*} %{g*:%{!g0:%{g*} \
                             %{!fno-working-directory:-fworking-directory}}} \
                             %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} \
                             %{O*} %{undef}"

The %b.s seems to be defined in gcc.c's cc1_options.


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

* [Bug fortran/47486] gfortran -M exits with fatal error when -o option is used
  2011-01-27  8:35 [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used thenlich at users dot sourceforge.net
  2011-01-27  9:16 ` [Bug fortran/47486] " burnus at gcc dot gnu.org
@ 2012-02-14 20:18 ` ktietz at gcc dot gnu.org
  2012-02-15  9:35 ` burnus at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-02-14 20:18 UTC (permalink / raw)
  To: gcc-bugs

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

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-14
                 CC|                            |ktietz at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #2 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-02-14 20:18:12 UTC ---
I can confirm this bug


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

* [Bug fortran/47486] gfortran -M exits with fatal error when -o option is used
  2011-01-27  8:35 [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used thenlich at users dot sourceforge.net
  2011-01-27  9:16 ` [Bug fortran/47486] " burnus at gcc dot gnu.org
  2012-02-14 20:18 ` ktietz at gcc dot gnu.org
@ 2012-02-15  9:35 ` burnus at gcc dot gnu.org
  2012-02-15  9:41 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-15  9:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-15 09:33:45 UTC ---
Untested patch:

--- a/gcc/fortran/lang-specs.h
+++ b/gcc/fortran/lang-specs.h
@@ -68,7 +68,8 @@
 {"@f95",
     "f951 %i %{E:%{!cpp:%egfortran does not support -E without -cpp}}\
          %{cpp:" F951_CPP_OPTIONS ";:  " CPP_FORWARD_OPTIONS  "} \
-         %{!E:" F951_OPTIONS "}", 0, 0, 0},
+         %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:" F951_OPTIONS "}}}}}}",
+          0, 0, 0},


 #undef CPP_ONLY_OPTIONS


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

* [Bug fortran/47486] gfortran -M exits with fatal error when -o option is used
  2011-01-27  8:35 [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used thenlich at users dot sourceforge.net
                   ` (2 preceding siblings ...)
  2012-02-15  9:35 ` burnus at gcc dot gnu.org
@ 2012-02-15  9:41 ` burnus at gcc dot gnu.org
  2012-02-15 10:20 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-15  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-15 09:40:40 UTC ---
Missed some parts. Better patch - still completely untested (not even built). A
shorter version would be "%{!E:%{!M*:", which is also completely untested.

--- a/gcc/fortran/lang-specs.h
+++ b/gcc/fortran/lang-specs.h
@@ -56,3 +56,4 @@
           %{cpp:" F951_CPP_OPTIONS ";: " CPP_FORWARD_OPTIONS  "} \
-         %{!E:" F951_OPTIONS "}", 0, 0, 0},
+         %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{!MD:%{!MMD:" F951_OPTIONS "}}}}}}}",
+         0, 0, 0},
 {".F90", "@f95-cpp-input", 0, 0, 0},
@@ -70,3 +71,4 @@
          %{cpp:" F951_CPP_OPTIONS ";:  " CPP_FORWARD_OPTIONS  "} \
-         %{!E:" F951_OPTIONS "}", 0, 0, 0},
+         %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{!MD:%{!MMD:" F951_OPTIONS "}}}}}}}",
+          0, 0, 0},


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

* [Bug fortran/47486] gfortran -M exits with fatal error when -o option is used
  2011-01-27  8:35 [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used thenlich at users dot sourceforge.net
                   ` (3 preceding siblings ...)
  2012-02-15  9:41 ` burnus at gcc dot gnu.org
@ 2012-02-15 10:20 ` jakub at gcc dot gnu.org
  2012-02-15 15:32 ` ktietz at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-15 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-15 10:18:53 UTC ---
Can't you do
"%{E|M|MM|MT|MQ|MD|MMD:;:" F951_OPTIONS "}"
instead?


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

* [Bug fortran/47486] gfortran -M exits with fatal error when -o option is used
  2011-01-27  8:35 [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used thenlich at users dot sourceforge.net
                   ` (4 preceding siblings ...)
  2012-02-15 10:20 ` jakub at gcc dot gnu.org
@ 2012-02-15 15:32 ` ktietz at gcc dot gnu.org
  2012-02-15 15:52 ` burnus at gcc dot gnu.org
  2014-09-08 13:40 ` jtravs at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-02-15 15:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-02-15 15:30:58 UTC ---
I have tested variant suggested in #comment 4 and those in #comment 5.  Both
are fixing the ICE.  The file test.d (as used as crash example) will be created
empty.


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

* [Bug fortran/47486] gfortran -M exits with fatal error when -o option is used
  2011-01-27  8:35 [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used thenlich at users dot sourceforge.net
                   ` (5 preceding siblings ...)
  2012-02-15 15:32 ` ktietz at gcc dot gnu.org
@ 2012-02-15 15:52 ` burnus at gcc dot gnu.org
  2014-09-08 13:40 ` jtravs at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-15 15:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-15 15:51:45 UTC ---
(In reply to comment #5)
> "%{E|M|MM|MT|MQ|MD|MMD:;:" F951_OPTIONS "}"

Good idea - and looks cleaner. Except (my bug) that -MD and -MMD do not imply
"-E". Thus, those shouldn't appear in that list.

Additionally, with -M the output goes - according to Kai (thanks for testing!)
- still to stdout. I think the "if (gfc_cpp_preprocess_only ())" in
fortran/cpp.c's gfc_cpp_init_0 needs to be modified.


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

* [Bug fortran/47486] gfortran -M exits with fatal error when -o option is used
  2011-01-27  8:35 [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used thenlich at users dot sourceforge.net
                   ` (6 preceding siblings ...)
  2012-02-15 15:52 ` burnus at gcc dot gnu.org
@ 2014-09-08 13:40 ` jtravs at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: jtravs at gmail dot com @ 2014-09-08 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

John Travers <jtravs at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jtravs at gmail dot com

--- Comment #8 from John Travers <jtravs at gmail dot com> ---
I also can confirm this bug on 4.9.1, any progress?


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

end of thread, other threads:[~2014-09-08 13:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27  8:35 [Bug fortran/47486] New: gfortran -M exits with fatal error when -o option is used thenlich at users dot sourceforge.net
2011-01-27  9:16 ` [Bug fortran/47486] " burnus at gcc dot gnu.org
2012-02-14 20:18 ` ktietz at gcc dot gnu.org
2012-02-15  9:35 ` burnus at gcc dot gnu.org
2012-02-15  9:41 ` burnus at gcc dot gnu.org
2012-02-15 10:20 ` jakub at gcc dot gnu.org
2012-02-15 15:32 ` ktietz at gcc dot gnu.org
2012-02-15 15:52 ` burnus at gcc dot gnu.org
2014-09-08 13:40 ` jtravs at gmail dot com

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).