* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
@ 2014-03-06 14:04 ` kargl at gcc dot gnu.org
2014-03-06 14:05 ` kargl at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kargl at gcc dot gnu.org @ 2014-03-06 14:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #1 from kargl at gcc dot gnu.org ---
Use the -o option.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
2014-03-06 14:04 ` [Bug fortran/60447] " kargl at gcc dot gnu.org
@ 2014-03-06 14:05 ` kargl at gcc dot gnu.org
2014-03-06 14:07 ` vladimir.fuka at gmail dot com
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kargl at gcc dot gnu.org @ 2014-03-06 14:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|kargl at gcc dot gnu.org |
Severity|normal |trivial
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
2014-03-06 14:04 ` [Bug fortran/60447] " kargl at gcc dot gnu.org
2014-03-06 14:05 ` kargl at gcc dot gnu.org
@ 2014-03-06 14:07 ` vladimir.fuka at gmail dot com
2014-03-06 14:17 ` kargl at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: vladimir.fuka at gmail dot com @ 2014-03-06 14:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
--- Comment #2 from Vladimir Fuka <vladimir.fuka at gmail dot com> ---
-o option for what?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
` (2 preceding siblings ...)
2014-03-06 14:07 ` vladimir.fuka at gmail dot com
@ 2014-03-06 14:17 ` kargl at gcc dot gnu.org
2014-03-06 14:45 ` vladimir.fuka at gmail dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: kargl at gcc dot gnu.org @ 2014-03-06 14:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #3 from kargl at gcc dot gnu.org ---
(In reply to Vladimir Fuka from comment #2)
> -o option for what?
% ls *.s
ls: No match.
% ls foo.*
foo.F90
% gfortran46 -E -o foo.f90 -cpp foo.F90
% ls foo.* *.s
foo.F90 foo.f90
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
` (3 preceding siblings ...)
2014-03-06 14:17 ` kargl at gcc dot gnu.org
@ 2014-03-06 14:45 ` vladimir.fuka at gmail dot com
2014-03-06 15:02 ` sgk at troutmask dot apl.washington.edu
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: vladimir.fuka at gmail dot com @ 2014-03-06 14:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
--- Comment #4 from Vladimir Fuka <vladimir.fuka at gmail dot com> ---
I see, but I just wanted to print the content or pipe it somewhere, so I don't
think that resolves it.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
` (4 preceding siblings ...)
2014-03-06 14:45 ` vladimir.fuka at gmail dot com
@ 2014-03-06 15:02 ` sgk at troutmask dot apl.washington.edu
2014-03-06 17:08 ` sgk at troutmask dot apl.washington.edu
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2014-03-06 15:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Mar 06, 2014 at 02:45:38PM +0000, vladimir.fuka at gmail dot com wrote:
>
> I see, but I just wanted to print the content or pipe it somewhere, so I don't
> think that resolves it.
>
I did not say that it resolves the problem (as I obviously
did not close the PR). I'm showing you a way to eliminate
the spurious *.s file if it really bothers you.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
` (5 preceding siblings ...)
2014-03-06 15:02 ` sgk at troutmask dot apl.washington.edu
@ 2014-03-06 17:08 ` sgk at troutmask dot apl.washington.edu
2014-03-08 11:42 ` burnus at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2014-03-06 17:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
--- Comment #6 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Mar 06, 2014 at 03:01:52PM +0000, sgk at troutmask dot
apl.washington.edu wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
>
> --- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
> On Thu, Mar 06, 2014 at 02:45:38PM +0000, vladimir.fuka at gmail dot com wrote:
> >
> > I see, but I just wanted to print the content or pipe it somewhere,
> > so I don't think that resolves it.
> >
>
> I did not say that it resolves the problem (as I obviously
> did not close the PR). I'm showing you a way to eliminate
> the spurious *.s file if it really bothers you.
Possible patch.
Index: cpp.c
===================================================================
--- cpp.c (revision 207633)
+++ cpp.c (working copy)
@@ -536,16 +536,13 @@ gfc_cpp_init_0 (void)
if (gfc_cpp_preprocess_only ())
{
+ /* If only cpp is desired, then a hack is needed to redirect assembler
+ output (actually nothing as -E implies -fsyntax-only) to another
+ file, otherwise the output from preprocessing is lost. */
+ asm_file_name = gfc_cpp_option.temporary_filename;
+
if (gfc_cpp_option.output_filename)
{
- /* This needs cheating: with "-E -o <file>", the user wants the
- preprocessed output in <file>. However, if nothing is done
- about it <file> is also used for assembler output. Hence, it
- is necessary to redirect assembler output (actually nothing
- as -E implies -fsyntax-only) to another file, otherwise the
- output from preprocessing is lost. */
- asm_file_name = gfc_cpp_option.temporary_filename;
-
print.outf = fopen (gfc_cpp_option.output_filename, "w");
if (print.outf == NULL)
gfc_fatal_error ("opening output file %s: %s",
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
` (6 preceding siblings ...)
2014-03-06 17:08 ` sgk at troutmask dot apl.washington.edu
@ 2014-03-08 11:42 ` burnus at gcc dot gnu.org
2014-03-08 18:53 ` burnus at gcc dot gnu.org
2014-03-08 18:55 ` burnus at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-03-08 11:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-03-08
CC| |burnus at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> ---
gcc/fortran/options.c's gfc_post_options contains:
/* FIXME: return gfc_cpp_preprocess_only ();
The return value of this function indicates whether the
backend needs to be initialized. On -E, we don't need
the backend. However, if we return 'true' here, an
ICE occurs. Initializing the backend doesn't hurt much,
hence, for now we can live with it as is. */
return false;
* * *
If one returns true, it indeed fails with a segfault.
* * *
For C, its LANG_HOOKS_INIT (= c_objc_common_init) has:
if (c_common_init () == false)
return false;
which returns "false" for flag_preprocess_only.
I think, we have to do something similar for gfortran's LANG_HOOKS_INIT (=
gfc_init).
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
` (7 preceding siblings ...)
2014-03-08 11:42 ` burnus at gcc dot gnu.org
@ 2014-03-08 18:53 ` burnus at gcc dot gnu.org
2014-03-08 18:55 ` burnus at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-03-08 18:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Sat Mar 8 18:53:18 2014
New Revision: 208431
URL: http://gcc.gnu.org/viewcvs?rev=208431&root=gcc&view=rev
Log:
2014-03-08 Tobias Burnus <burnus@net-b.de>
PR fortran/60447
* f95-lang.c (gfc_init): Return false when only
preprocessing.
* options.c (gfc_post_options): Ditto.
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/f95-lang.c
trunk/gcc/fortran/options.c
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/60447] Empty .s file created when using -E flag
2014-03-06 12:51 [Bug fortran/60447] New: Empty .s file created when using -E flag vladimir.fuka at gmail dot com
` (8 preceding siblings ...)
2014-03-08 18:53 ` burnus at gcc dot gnu.org
@ 2014-03-08 18:55 ` burnus at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-03-08 18:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60447
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED on the 4.9 trunk.
Thanks for the report!
^ permalink raw reply [flat|nested] 11+ messages in thread