public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, fortran] PR41909 [4.4/4.5 Regression] ICE with "call foo" in  "program foo"
@ 2009-11-06  4:33 Jerry DeLisle
  2009-11-06  8:38 ` Janne Blomqvist
  0 siblings, 1 reply; 3+ messages in thread
From: Jerry DeLisle @ 2009-11-06  4:33 UTC (permalink / raw)
  To: gfortran list; +Cc: gcc patches

Hi Folks,

This simple patch avoids the assertion that is giving the ICE.

Regression tested on x86-64.

With the patch, the test case in the PR gives:

$ gfc pr41909.f90
pr41909.f90:3.13:

   call test()
              1
pr41909.f90:1.12:

program test
             2
Error: Global name 'test' at (1) is already being used as a PROGRAM at (2)


OK for trunk?

Regards,

Jerry

Index: resolve.c
===================================================================
--- resolve.c	(revision 153956)
+++ resolve.c	(working copy)
@@ -1117,6 +1117,9 @@
    gfc_symbol* context_proc;
    gfc_namespace* real_context;

+  if (sym->attr.flavor == FL_PROGRAM)
+    return false;
+
    gcc_assert (sym->attr.flavor == FL_PROCEDURE);

    /* If we've got an ENTRY, find real procedure.  */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch, fortran] PR41909 [4.4/4.5 Regression] ICE with "call  foo" in  "program foo"
  2009-11-06  4:33 [patch, fortran] PR41909 [4.4/4.5 Regression] ICE with "call foo" in "program foo" Jerry DeLisle
@ 2009-11-06  8:38 ` Janne Blomqvist
  2009-11-06 15:20   ` Jerry DeLisle
  0 siblings, 1 reply; 3+ messages in thread
From: Janne Blomqvist @ 2009-11-06  8:38 UTC (permalink / raw)
  To: Jerry DeLisle; +Cc: gfortran list, gcc patches

Jerry DeLisle wrote:
> Hi Folks,
> 
> This simple patch avoids the assertion that is giving the ICE.
> 
> Regression tested on x86-64.
> 
> With the patch, the test case in the PR gives:
> 
> $ gfc pr41909.f90
> pr41909.f90:3.13:
> 
>   call test()
>              1
> pr41909.f90:1.12:
> 
> program test
>             2
> Error: Global name 'test' at (1) is already being used as a PROGRAM at (2)
> 
> 
> OK for trunk?

Ok, provided you also commit a changelog entry and a testcase for the 
testsuite.

Does the same patch also apply to 4.4 and gets rid of the ICE? It seems 
a backport is in order.


-- 
Janne Blomqvist

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch, fortran] PR41909 [4.4/4.5 Regression] ICE with "call foo"  in  "program foo"
  2009-11-06  8:38 ` Janne Blomqvist
@ 2009-11-06 15:20   ` Jerry DeLisle
  0 siblings, 0 replies; 3+ messages in thread
From: Jerry DeLisle @ 2009-11-06 15:20 UTC (permalink / raw)
  To: Janne Blomqvist; +Cc: gfortran list, gcc patches

On 11/06/2009 12:34 AM, Janne Blomqvist wrote:
> Jerry DeLisle wrote:
>> Hi Folks,
>>
>> This simple patch avoids the assertion that is giving the ICE.
>>
>> Regression tested on x86-64.
>>
>> With the patch, the test case in the PR gives:
>>
>> $ gfc pr41909.f90
>> pr41909.f90:3.13:
>>
>> call test()
>> 1
>> pr41909.f90:1.12:
>>
>> program test
>> 2
>> Error: Global name 'test' at (1) is already being used as a PROGRAM at
>> (2)
>>
>>
>> OK for trunk?
>
> Ok, provided you also commit a changelog entry and a testcase for the
> testsuite.
>
> Does the same patch also apply to 4.4 and gets rid of the ICE? It seems
> a backport is in order.
>
>
Yes I will do a ChangeLog and test case.  I will check 4.4 and see what happens.

Jerry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-06 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-06  4:33 [patch, fortran] PR41909 [4.4/4.5 Regression] ICE with "call foo" in "program foo" Jerry DeLisle
2009-11-06  8:38 ` Janne Blomqvist
2009-11-06 15:20   ` Jerry DeLisle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).