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]

Re: [patch, RFC] Fix PR 30389 - ASCII functions


On Mon, Jan 22, 2007 at 11:26:45PM -0800, Brooks Moses wrote:

> Thus, assuming that everything is ASCII, I suggest that returning the 
> same results as CHAR for all in-range values is appropriate.  Whether we 
> want to use the lowest eight bits or return CHAR(0) for out-of-range 
> values is debateable; I prefer CHAR(0) but have no strong preferences.

Thanks, Brooks, for the work you have done researching this.

Here is an updated patch, also with a new test case.  I added the
warnings that Brooks suggested.  I also changed the handling of
extract_int (which was broken before, because it should never fail,
and if it did, we'd be assigning a random value to the function
return).

OK?

2007-01-22  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30389
	* gfortran.h:  Remove gfc_simplify_init_1.
	* arith.h:  Remove third argument from gfc_compare_string.
	* arith.c(gfc_compare_expression):  Remove third argument
	from call to gfc_compare_string.
	(gfc_compare_string):  Remove third argument xcoll_table.
	Remove use of xcoll_table.
	* misc.c(gfc_init_1):  Remove call to gfc_simplify_init_1.
	* simplify.c(ascii_table):  Remove.
	(xascii_table): Likewise.
	(gfc_simplify_achar):  ICE if extract_int fails.  Remove use of
	ascii_table.  Warn if -Wsurprising and value < 0 or > 127.
	(gfc_simplify_char):  ICE if extract_int fails. Warn if
	-Wsurprising and value < 0 or value > 255.
	(gfc_simplify_iachar):  Remove use of xascii_table.
	Char values outside of 0..255 are an ICE.
	(gfc_simplify_lge):  Remove use of xascii_table.
	(gfc_simplify_lgt):  Likewise.
	(gfc_simplify_lle):  Likewise.
	(gfc_simplify_llt):  Likewise.
	(invert_table):  Remove.
	(gfc_simplify_init_1):  Remove.

2007-01-22  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/30389
	* gfortran.dg/achar_2.f90:  New test.
	* gfortran.dg/achar_3.f90:  New test.

Attachment: achar-2-patch
Description: Text document

Attachment: achar_2.f90
Description: Text document

Attachment: achar_3.f90
Description: Text document


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