public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/60447] New: Empty .s file created when using -E flag
@ 2014-03-06 12:51 vladimir.fuka at gmail dot com
  2014-03-06 14:04 ` [Bug fortran/60447] " kargl at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: vladimir.fuka at gmail dot com @ 2014-03-06 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60447
           Summary: Empty .s file created when using -E flag
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vladimir.fuka at gmail dot com

> touch test.f90
> gfortran -E -cpp test.f90
# 1 "test.f90"
# 1 "<command-line>"
# 1 "test.f90"

> ls -l test.s
-rw-r--r-- 1 lada users 0  6. bře 13.47 test.s


C and C++ front-ends do not do this

> touch test.c
> gfortran -E -cpp test.c
# 1 "test.c"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "test.c"
> ls -l test.s
ls: cannot access test.s: No such file or directory
>From gcc-bugs-return-445618-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 06 13:06:44 2014
Return-Path: <gcc-bugs-return-445618-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21210 invoked by alias); 6 Mar 2014 13:06:44 -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 21159 invoked by uid 48); 6 Mar 2014 13:06:41 -0000
From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/60236] gfortran.dg/vect/pr32380.f fails on ARM
Date: Thu, 06 Mar 2014 13:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: bernd.edlinger at hotmail dot de
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-60236-4-9bU8Fm0Hhe@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60236-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60236-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-03/txt/msg00487.txt.bz2
Content-length: 453

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`236

Bernd Edlinger <bernd.edlinger at hotmail dot de> changed:

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

--- Comment #9 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
should be fixed now.


^ 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 ` 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

end of thread, other threads:[~2014-03-08 18:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
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

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