Bug 20138 - fortran (driver?) bug: array bound checking conflicts with preprocessing
Summary: fortran (driver?) bug: array bound checking conflicts with preprocessing
Status: RESOLVED DUPLICATE of bug 18452
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-22 08:40 UTC by Harald Anlauf
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Anlauf 2005-02-22 08:40:55 UTC
Hi,

save the following dummy program as gfcbug24.F90 (capital "F"):

program gfcbug24_F90
  print *, "Hey, it works now!"
end program gfcbug24_F90

Then compile with:

% gfortran -C gfcbug24.F90

I get:

gfortran: GCC does not support -C or -CC without -E

Preprocessing normally works, but the -C options seems to interfere
here.  -E is certainly not what I want...

Cheers,
-ha
Comment 1 Harald Anlauf 2005-02-22 08:48:02 UTC
It looks very much like a driver problem, because the option -std=f95
instead of -C makes it even funnier:

cc1: warning: command line option "-std=f95" is valid for F95 but not for C

But at least it does compile...

-ha
Comment 2 Harald Anlauf 2005-02-22 08:54:29 UTC
While I'm at it: the option -pipe also has a funny side effect:

f951: error: unrecognized command line option "-95"

And it produces a file "-95" in the current directory that contains
the preprocessed source.  Oh well...

-ha
Comment 3 Andrew Pinski 2005-02-22 14:06:02 UTC
-C is not valid option at all for bound checking.  -fbounds-check is the correct option.



*** This bug has been marked as a duplicate of 18452 ***
Comment 4 GCC Commits 2005-04-10 08:36:04 UTC
Subject: Bug 20138

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tkoenig@gcc.gnu.org	2005-04-10 08:35:40

Modified files:
	libgfortran    : ChangeLog 
	libgfortran/io : transfer.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: eor_handling_1.f90 eor_handling_2.f90 
	                           eor_handling_3.f90 eor_handling_4.f90 
	                           eor_handling_5.f90 noadv_size.f90 
	                           pad_no.f90 

Log message:
	2005-04-10  Thomas Koenig <Thomas.Koenig@online.de>
	
	PR libfortran/17992
	PR libfortran/19568
	PR libfortran/19595
	PR libfortran/20005
	PR libfortran/20092
	PR libfortran/20131
	PR libfortran/20138
	PR libfortran/20661
	PR libfortran/20744
	* io/transfer.c (top level): eor_condition: New static variable.
	(read_sf): Remove unnecessary zeroing of buffer (there is enough
	information in its length).
	Return a string of length 0 (to be padded by caller) if EOR was
	seen previously.
	Remove erroneous special casing of EOR for standard input.
	Set eor_condition for non-advancing I/O if an end of line was
	detected.
	Increment ioparm.size if necessary.
	(formatted_transfer):  Skip the function if there is an EOR condition.
	(data_transfer_init):  Initialize eor_condition to zero (false).
	(next_record_r):  Clear sf_seen_eor if a \n has been seen already.
	(finalize_transfer):  If there is an EOR condition, raise the error.
	
	2005-04-10   Thomas Koenig  <Thomas.Koenig@online.de>
	
	* eor_handling_1.f90: New test case.
	* eor_handling_2.f90: New test case.
	* eor_handling_3.f90: New test case.
	* eor_handling_4.f90: New test case.
	* eor_handling_5.f90: New test case.
	* noadv_size.f90: New test case.
	* pad_no.f90: New test case.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.188&r2=1.189
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/transfer.c.diff?cvsroot=gcc&r1=1.35&r2=1.36
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5320&r2=1.5321
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/eor_handling_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/eor_handling_2.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/eor_handling_3.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/eor_handling_4.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/eor_handling_5.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/noadv_size.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/pad_no.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 5 Thomas Koenig 2005-04-10 08:44:10 UTC
(In reply to comment #4)
> Subject: Bug 20138


Whoops, an erroneous entry in the Changelog here.