Bug 28971 - ICE: Segmentation fault on valid code
Summary: ICE: Segmentation fault on valid code
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-07 09:28 UTC by Oskar Enoksson
Modified: 2006-09-12 08:59 UTC (History)
1 user (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Valid code snippet that causes ICE (125 bytes, application/octet-stream)
2006-09-07 09:31 UTC, Oskar Enoksson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oskar Enoksson 2006-09-07 09:28:51 UTC
When compiling a small file with standard flags the compiler crashes.
This seems to be related to a WHERE construct.
The code is accepted without warnings by e.g. Intel fortran compiler and others.
The version of gfortran is 4.2.0 20060819
Comment 1 Oskar Enoksson 2006-09-07 09:31:00 UTC
Created attachment 12201 [details]
Valid code snippet that causes ICE

gfortran -c tst.f90
tst.f90:0: 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.
Comment 2 Paul Thomas 2006-09-07 16:16:04 UTC
Oskar,

This works for me with gcc-4.2.0 20060905; I know of nothing that would have effected this change so I am at a bit of a loss.  I hung a main program on it and checked the output too.

Paul
Comment 3 kargls 2006-09-07 16:58:51 UTC
Paul, the code fails with

troutmask:kargl[205] gfc --version
GNU Fortran 95 (GCC) 4.2.0 20060711 (experimental)
Copyright (C) 2006 Free Software Foundation, Inc.

but works with

troutmask:sgk[248] gfc4x --version
GNU Fortran 95 (GCC) 4.2.0 20060906 (experimental)
Copyright (C) 2006 Free Software Foundation, Inc.

On a quick scan of ChangeLog, I did not see an entry that jumps out that
fixed/caused the problem.

Oskar,

Can you update to a newer version and verify the code works?
Comment 4 Paul Thomas 2006-09-12 08:59:18 UTC
Oskar,

We believe that this bug is "fixed"; however, I will take you tst.f90 and put it in the gfortran testsuite, since we do not know what moved to produce both the regression and the "fix".

As I said to the list, we will be very grateful if you would submit any problems that you might have in the future.

Paul Thomas
Comment 5 Oskar Enoksson 2006-09-12 09:15:33 UTC
Subject: Re:  ICE: Segmentation fault on valid code

Yes that's fine with me.

I don't have access to the computer where I originally noticed the 
problem until the end of the week so I haven't been able to try any 
later snapshot version. I have compiled the latest trunk on a different 
machine (i686) and have verified that the testcase compiles without 
crash there. So it appears to be fixed.

Thanks for the response!
/Oskar

pault at gcc dot gnu dot org wrote:
> ------- Comment #4 from pault at gcc dot gnu dot org  2006-09-12 08:59 -------
> Oskar,
>
> We believe that this bug is "fixed"; however, I will take you tst.f90 and put
> it in the gfortran testsuite, since we do not know what moved to produce both
> the regression and the "fix".
>
> As I said to the list, we will be very grateful if you would submit any
> problems that you might have in the future.
>
> Paul Thomas
>
>
>   

Comment 6 Paul Thomas 2006-09-12 19:38:58 UTC
Subject: Bug 28971

Author: pault
Date: Tue Sep 12 19:38:48 2006
New Revision: 116904

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116904
Log:
2006-09-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/28971
	gfortran.dg/pr28971.f90: New test to act as a backstop in case
	this undiagnosed regression reappears.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr28971.f90
Modified:
    trunk/gcc/testsuite/ChangeLog