|Summary:||[ABI cleanup] Move runtime parsing of I/O control list to front end|
|Product:||gcc||Reporter:||Thomas Koenig <tkoenig>|
|Component:||fortran||Assignee:||Not yet assigned to anyone <unassigned>|
|Build:||Known to work:|
|Known to fail:||Last reconfirmed:||2015-11-10 00:00:00|
|Bug Depends on:|
|Bug Blocks:||37577, 48419, 56818|
Description Thomas Koenig 2010-09-18 07:47:39 UTC
Currently, for code like WRITE (*,ADVANCE="NO") we compare the ADVANCE string in the library. This is wasteful in the vast majority of cases, where the corresponding strings are constant. We should do the string comparison in the front end, where it can be folded, and pass a bit field to the library. Something for the ABI cleanup, when it happens in 4.7.
Comment 1 Jerry DeLisle 2010-09-21 03:08:30 UTC
Here is a case where we do have to evaluate at run time. So maybe we can not do what is proposed above. character(10):: advancevar advancevar = "no" write(*, "(a)", advance=advancevar) "Well, " print *, "Does it work?" end ! Interestingly, if advancevar is a PARAMETER, we get an error.
Comment 2 Tobias Burnus 2010-09-21 06:54:38 UTC
(In reply to comment #1) > Here is a case where we do have to evaluate at run time. So maybe we can not > do what is proposed above. Well, I understood the request such that one passes a boolean for the 'YES' / 'NO' items. If it cannot be simplified at compile time, one adds (in trans*c) code like: advance = _gfortran_compare_string (3, &"YES", len, &str) == 0; Possibly, one should add a new function like advance = _gfortran_io_yes_no (len, &str, "ADVANCE"); which takes then also into account invalid values.
Comment 3 Thomas Koenig 2011-04-17 19:27:47 UTC
Actually, for many strings, we would need 'yes', 'no" and a value for 'not specified', so four bits instead of 32. Still better by a factor of 8, though :-)
Comment 4 Dominique d'Humieres 2015-11-10 13:29:32 UTC
Any progress after four years and a half?