Bug 30683 - [4.2 only] internal compiler error: Segmentation fault
Summary: [4.2 only] internal compiler error: Segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2007-02-02 22:01 UTC by Salvatore Filippone
Modified: 2007-02-03 19:01 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.3.0
Known to fail: 4.2.0 4.1.2
Last reconfirmed: 2007-02-03 10:33:57


Attachments
test case (390 bytes, text/plain)
2007-02-02 22:01 UTC, Salvatore Filippone
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salvatore Filippone 2007-02-02 22:01:13 UTC
The attached code produces the subject error. 
gfortran -c bug_n.f90 
bug_n.f90:45: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[sfilippo@localhost NEMO]$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.2-20070124/configure --prefix=/usr/local/gcc42 --with-mpfr=/home/travel/GCC/BUILDS/mpfr --with-gmp-lib=/home/travel/GCC/BUILDS/gmp/lib/ --with-gmp=/home/travel/GCC/BUILDS/gmp
Thread model: posix
gcc version 4.2.0 20070124 (prerelease)
Comment 1 Salvatore Filippone 2007-02-02 22:01:55 UTC
Created attachment 12999 [details]
test case
Comment 2 kargls 2007-02-02 23:44:17 UTC
I'm testing a patch for this at the moment.  The problem is you
have renamed SIZE to an interface.  That is, this is leading to
the segfault:


  interface size
     module procedure get_fld_size
  end interface

While the standard may permit this construct, it may be prudent to 
not rename standard intrinsic procedures.
Comment 3 kargls 2007-02-03 01:01:17 UTC
Subject: Bug 30683

Author: kargl
Date: Sat Feb  3 01:01:06 2007
New Revision: 121531

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121531
Log:
2007-02-02  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/30683
	* resolve.c (resolve_generic_f): Check for non-NULL sym.
	* gfortran.dg/interface_10.f90: New test.



Added:
    trunk/gcc/testsuite/gfortran.dg/interface_10.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 kargls 2007-02-03 01:07:55 UTC
Fixed on trunk.
Comment 5 Salvatore Filippone 2007-02-03 12:05:52 UTC
(In reply to comment #2)
> I'm testing a patch for this at the moment.  The problem is you
> have renamed SIZE to an interface.  That is, this is leading to
> the segfault:
> 
> 
>   interface size
>      module procedure get_fld_size
>   end interface
> 
> While the standard may permit this construct, it may be prudent to 
> not rename standard intrinsic procedures.
> 
Agreed. 
I take it you mean it IS standard conforming, right? 
Just to make sure. In any case, an ice is an ice.... 

Comment 6 Steve Kargl 2007-02-03 17:45:06 UTC
Subject: Re:  [4.2 only] internal compiler error: Segmentation fault

On Sat, Feb 03, 2007 at 12:05:53PM -0000, sfilippone at uniroma2 dot it wrote:
> 
> > I'm testing a patch for this at the moment.  The problem is you
> > have renamed SIZE to an interface.  That is, this is leading to
> > the segfault:
> > 
> > 
> >   interface size
> >      module procedure get_fld_size
> >   end interface
> > 
> > While the standard may permit this construct, it may be prudent to 
> > not rename standard intrinsic procedures.
> > 
> Agreed. 
> I take it you mean it IS standard conforming, right? 

I a quick scan of F2003, I could not find anything that
say the construct above is nonconforming.  So, I believe
that it is permitted.

> Just to make sure. In any case, an ice is an ice.... 

Yes, indeed.  Fortunately, this one was easy to find
and fix.

Comment 7 kargls 2007-02-03 19:00:08 UTC
Subject: Bug 30683

Author: kargl
Date: Sat Feb  3 18:59:53 2007
New Revision: 121548

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121548
Log:
2007-02-02  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/30683
	* resolve.c (resolve_generic_f): Check for non-NULL sym.
	* gfortran.dg/interface_10.f


Added:
    branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/interface_10.f90
Modified:
    branches/gcc-4_2-branch/gcc/fortran/ChangeLog
    branches/gcc-4_2-branch/gcc/fortran/resolve.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog

Comment 8 kargls 2007-02-03 19:01:13 UTC
Fixed on 4.2.