Bug 23862 - Select Fortran source form appropriately for "-pipe"
Summary: Select Fortran source form appropriately for "-pipe"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.1
: P2 normal
Target Milestone: 4.1.2
Assignee: Francois-Xavier Coudert
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: patch
Depends on:
Blocks:
 
Reported: 2005-09-13 16:05 UTC by Maciej W. Rozycki
Modified: 2006-07-02 21:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.1.2 4.2.0
Known to fail:
Last reconfirmed: 2006-06-21 11:14:44


Attachments
gcc-4.0.1-fortran-form-free.patch (398 bytes, patch)
2005-09-13 16:06 UTC, Maciej W. Rozycki
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej W. Rozycki 2005-09-13 16:05:23 UTC
When "-pipe" is used for .F90 and .F95 sources this warning is produced:

Warning: Reading file '<stdin>' as free form.

The reason is the compiler cannot deduce the form from the file name 
suffix as in this case it's only known to the preprocessor.

 Here is an obvious patch following the approach used for .F/.fpp/.FPP and 
.f/.for/.FOR files.

2005-08-22  Maciej W. Rozycki  <macro@linux-mips.org>

	* fortran/lang-specs.h: Pass "-ffree-form" by default for Fortran 
	90 sources.

 Tested successfully in a native bootstrap for "i386-linux-gnu" for GCC
4.0.1.  Inspection of sources shows it is needed for HEAD as well.
Comment 1 Maciej W. Rozycki 2005-09-13 16:06:08 UTC
Created attachment 9719 [details]
gcc-4.0.1-fortran-form-free.patch
Comment 2 Andrew Pinski 2005-09-13 20:03:52 UTC
Confirmed.
Comment 3 Francois-Xavier Coudert 2006-06-21 11:14:44 UTC
I'm rediscovering that bug, so I'm assigning this bug to myself in order to not forget it again :)

One remark: I don't understand exactly why the second part would be needed:

-{"@f95", "%{!E:f951 %i %(cc1_options) %{J*} %{I*}\
+{"@f95", "%{!E:f951 %i %{!ffixed-form:-ffree-form} %(cc1_options) %{J*} %{I*}\
          %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0},

as currently, the @f95 sources (files with .f95 and .f90) are compiled correctly.
Comment 4 Francois-Xavier Coudert 2006-06-24 16:06:39 UTC
Subject: Bug 23862

Author: fxcoudert
Date: Sat Jun 24 16:06:28 2006
New Revision: 114970

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114970
Log:
	PR fortran/23862
	* lang-specs.h (f95-cpp-input): Pass -ffree-form to f951 unless
	-ffixed-form is explicitly specified.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/lang-specs.h

Comment 5 Francois-Xavier Coudert 2006-07-02 21:17:20 UTC
Subject: Bug 23862

Author: fxcoudert
Date: Sun Jul  2 21:17:05 2006
New Revision: 115134

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115134
Log:
	PR fortran/28094
	* trans-intrinsic.c (gfc_conv_intrinsic_mod): Support cases where
	there is no integer kind equal to the resulting real kind.
	* intrinsic.c (add_functions): MODULO is not allowed as an actual
	argument.
	* Makefile.am: Add _mod_r10.F90 and _mod_r16.F90.
	* Makefile.in: Regenerate.
	* generated/_mod_r10.F90: New file.
	* generated/_mod_r16.F90: New file.

	PR fortran/27965
	* trans-array.c (gfc_conv_ss_startstride): Correct the runtime
	conditions for bounds-checking. Check for nonzero stride.
	Don't check the last dimension of assumed-size arrays. Fix the
	dimension displayed in the error message.

	PR fortran/26801
	* trans-intrinsic.c (gfc_conv_associated): Use pre and post blocks
	of the scalarization expression.
	* gfortran.dg/associated_4.f90: New test.

	PR fortran/28081
	* resolve.c (resolve_substring): Don't issue out-of-bounds
	error messages when the range has zero size.
	* gfortran.dg/substr_3.f: New test.
	* gfortran.dg/equiv_2.f90: Update expected error message.

	PR fortran/23862
	* lang-specs.h (f95-cpp-input): Pass -ffree-form to f951 unless
	-ffixed-form is explicitly specified.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/associated_4.f90
      - copied unchanged from r114757, trunk/gcc/testsuite/gfortran.dg/associated_4.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/substr_3.f
      - copied unchanged from r114972, trunk/gcc/testsuite/gfortran.dg/substr_3.f
    branches/gcc-4_1-branch/libgfortran/generated/_mod_r10.F90
      - copied unchanged from r114961, trunk/libgfortran/generated/_mod_r10.F90
    branches/gcc-4_1-branch/libgfortran/generated/_mod_r16.F90
      - copied unchanged from r114961, trunk/libgfortran/generated/_mod_r16.F90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/intrinsic.c
    branches/gcc-4_1-branch/gcc/fortran/lang-specs.h
    branches/gcc-4_1-branch/gcc/fortran/resolve.c
    branches/gcc-4_1-branch/gcc/fortran/trans-array.c
    branches/gcc-4_1-branch/gcc/fortran/trans-intrinsic.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/equiv_2.f90
    branches/gcc-4_1-branch/libgfortran/ChangeLog
    branches/gcc-4_1-branch/libgfortran/Makefile.am
    branches/gcc-4_1-branch/libgfortran/Makefile.in

Comment 6 Francois-Xavier Coudert 2006-07-02 21:22:35 UTC
Fixed.