This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fortran/25106 -- Statement labels are nonzero.


The attach patch has been bootstrapped and regression 
tested on i386-*-freebsd for mainline.  I'm currently
bootstrap and regtesting on amd64-*-freebsd on both
4.1 and mainline.  OK for 4.1 and mainline once amd64
completes.

Here's the problem.

kargl[206] cat jvm1.f90 
0 CONTINUE
END
kargl[205] gfc41 -o z jvm1.f90
 In file jvm1.f90:1

0 CONTINUE
1
Warning: Ignoring statement label of zero at (1)
 In file jvm1.f90:2

END
  1
 Internal Error at (1):
 free_expr0(): Bad expr type

This patch converts the warning into an error if the new
-fstatement-label-0 flag is not given.  The F95 standard
on page 24 says "Constraint:  At least one digit in a label
shall be nonzero."  Note, this patch also fixes the 
parastic Internal Error.  Also note, there is no negative
form of this flag.  You either get an error or a warning.
The only way to turn off the warning is with the -w option.

2005-11-27  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/25106
	* gfortran.h: New flag -fstatement-label-0
 	* match.c (gfc_match_st_label):  Eliminate second argument,
	improve warning/error handling;
	(gfc_match_small_int,gfc_match,gfc_match_do,gfc_match_goto):
	Update function calls.
	* match.h (gfc_match_st_label): Update prototype.
	* lang.opt: Add option; Alphabetize other out-of-order options.
	* io.c (match_dt_format): Update function calls.
	* parse.c (next_free): Update function calls; Eliminate warning.
	* invoke.texi: Document option.
	* options.c (gfc_init_options,gfc_post_options,gfc_handle_option):
	Set option.

2005-11-27  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/25106
	gfortran.dg/statement_label_1.f90: New tests.
	gfortran.dg/statement_label_2.f90: New tests.

-- 
Steve

Attachment: pr25106.diff
Description: Text document

Attachment: statement_label_1.f90
Description: Text document

Attachment: statement_label_2.f90
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]