FORTRAN :PATCH FOR PR 7179

Bud Davis bdavis9659@comcast.net
Thu May 22 14:22:00 GMT 2003


Toon Moene wrote:

> bdavis wrote:
>
>> The problem:
>>
>>      dimension  a(250000,250000)
>>      a(1,1)= 0.
>>      write(*,*) ' a',a(1,1)
>>      end
>>
>> gives no error message.
>>
>>
>> Here is what it should do:
>>
>>
>> big.f: In program `MAIN__':
>> big.f:1:
>>         dimension  a(250000,250000)
>>                    ^
>> Array `a' at (^) is too large to handle.
>>
>> Patch tested on i386 / linux with no new failures. The above snippet 
>> can be added to the "non-compile" directory of the testsuite.
>>    (Toon, what is the best way to post new test files?)
>>
>> --bud davis
>>
>> ---------------------------------------------------------------------------------------------------------------------------------------- 
>>
>> Index: gcc/gcc/f/com.c
>> ===================================================================
>> RCS file: /cvs/gcc/gcc/gcc/f/com.c,v
>> retrieving revision 1.195
>> diff -c -3 -p -r1.195 com.c
>> *** gcc/gcc/f/com.c     13 May 2003 18:06:48 -0000      1.195
>> --- gcc/gcc/f/com.c     18 May 2003 21:57:36 -0000
>> *************** ffecom_sym_transform_ (ffesymbol s)
>> *** 7407,7420 ****
>>          {
>>            ffestorag st = ffesymbol_storage (s);
>>            tree type;
>> -
>> -           if ((st != NULL)
>> -               && (ffestorag_size (st) == 0))
>> -             {
>> -               t = error_mark_node;
>> -               break;
>> -             }
>> -
>>            type = ffecom_type_localvar_ (s, bt, kt);
>>
>>            if (type == error_mark_node)
>> --- 7407,7412 ----
>>
> Hmmmm, can we be sure that `s' being "too large" is the only reason 
> that ffestorag_size (st) is zero ?




Below is a patch that moves the test "ffestorag_size (st) ==0" so it 
happens after the error has been diagnosed.
bootstrapped on i686-pc-linux-gnu with no additional testsuite failures.

regards,
bud davis


Index: gcc/gcc/f/com.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/com.c,v
retrieving revision 1.195
diff -c -3 -p -r1.195 com.c
*** gcc/gcc/f/com.c     13 May 2003 18:06:48 -0000      1.195
--- gcc/gcc/f/com.c     22 May 2003 02:50:19 -0000
*************** ffecom_sym_transform_ (ffesymbol s)
*** 7408,7420 ****
            ffestorag st = ffesymbol_storage (s);
            tree type;

-           if ((st != NULL)
-               && (ffestorag_size (st) == 0))
-             {
-               t = error_mark_node;
-               break;
-             }
-
            type = ffecom_type_localvar_ (s, bt, kt);

            if (type == error_mark_node)
--- 7408,7413 ----
*************** ffecom_sym_transform_ (ffesymbol s)
*** 7422,7427 ****
--- 7415,7427 ----
                t = error_mark_node;
                break;
              }
+
+             if ((st != NULL)
+                 && (ffestorag_size (st) == 0))
+               {
+                 t = error_mark_node;
+                 break;
+               }

            if ((st != NULL)
                && (ffestorag_parent (st) != NULL))






More information about the Gcc-patches mailing list