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, libfortran] PR45629 Get rid of setjmp/longjmp in the IO library


On Tue, Nov 2, 2010 at 05:27, Jerry DeLisle <jvdelisle@frontier.com> wrote:
> On 11/01/2010 04:30 PM, Janne Blomqvist wrote:
>>
>> Hi,
>>
>> the attached patch gets rid of the setjmp()/longjmp() based EOF
>> handling in list directed reads. It also fixes PR 45629.
>>
>> Tested on x86_64-unknown-linux-gnu, Ok for trunk? ÂI understand stage
>> 1 just ended, and as EOF handling has been a rich source of tricky
>> bugs in the IO library, I'm perfectly Ok with postponing this until
>> 4.7.
>
> Overall I like the patch.
>
> I am concerned about the changes to st_parameter_dt. ÂTo be on the safe side
> I wonder if you should do something like this? Â(Maybe I worry too much. Â;)
> )

Yes, I think you worry too much in this case. The part of
st_parameter_dt I have modified is never touches by the frontend, the
frontend just allocates space on the stack for the library to use. A
condensed version is

struct st_parameter_dt
{

>
> Index: io.h
> ===================================================================
> --- io.h    Â(revision 164907)
> +++ io.h    Â(working copy)
> @@ -435,7 +427,7 @@ typedef struct st_parameter_dt
> Â Â Â Â Âunsigned format_not_saved : 1;
> Â Â Â Â Â/* 14 unused bits. Â*/
>
> - Â Â Â Â char last_char;
> + Â Â Â Â char old_last_char; /* Remove when ABI breaks. Â*/
> Â Â Â Â Âchar nml_delim;
>
> Â Â Â Â Âint repeat_count;
> @@ -446,7 +438,7 @@ typedef struct st_parameter_dt
> Â Â Â Â Âchar *scratch;
> Â Â Â Â Âchar *line_buffer;
> Â Â Â Â Âstruct format_data *fmt;
> - Â Â Â Â jmp_buf *eof_jump;
> + Â Â Â Â jmp_buf *eof_jump; /* Remove when ABI breaks. Â*/
> Â Â Â Â Ânamelist_info *ionml;
> Â Â Â Â Â/* A flag used to identify when a non-standard expanded namelist
> read
> Â Â Â Â Â Â has occurred. Â*/
> @@ -456,6 +448,7 @@ typedef struct st_parameter_dt
> Â Â Â Â Â Â largest kind. Â*/
> Â Â Â Â Âchar value[32];
> Â Â Â Â ÂGFC_IO_INT size_used;
> + Â Â Â Â int last_char;
> Â Â Â Â} p;
> Â Â Â /* This pad size must be equal to the pad_size declared in
> Â Â Â Â trans-io.c (gfc_build_io_library_fndecls). ÂThe above structure
>
> Otherwise patch is OK.
>
> Jerry
>



-- 
Janne Blomqvist


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