public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/44177]  New: gfortran internal data assignment error cause found
@ 2010-05-17 20:21 harry dot rockefeller at flightsafety dot com
  2010-05-17 20:30 ` [Bug fortran/44177] " kargl at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: harry dot rockefeller at flightsafety dot com @ 2010-05-17 20:21 UTC (permalink / raw)
  To: gcc-bugs

System info: uname -a
CYGWIN_NT-5.1 harryr-pc 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 Cygwin
 gfortran -v
Using built-in specs.
Target: i686-pc-cygwin
Configured with:
/gnu/gcc/releases/packaging/4.3.4-3/gcc4-4.3.4-3/src/gcc-4.3.4/configure
--srcdir=/gnu/gcc/releases/packaging/4.3.4-3/gcc4-4.3.4-3/src/gcc-4.3.4
--prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var
--sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man
--datadir=/usr/share --infodir=/usr/share/info --mandir=/usr/share/man -v
--with-gmp=/usr --with-mpfr=/usr --enable-bootstrap
--enable-version-specific-runtime-libs --with-slibdir=/usr/bin
--libexecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc
--disable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2
--disable-sjlj-exceptions
--enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --disable-symvers
--enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp
--enable-libada --enable-threads=posix --with-arch=i686 --with-tune=generic
--enable-libgcj-sublibs CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4
CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TARGET=gnatmake GNATBIND_FOR_TARGET=gnatbind
AS=/opt/gcc-tools/bin/as.exe AS_FOR_TARGET=/opt/gcc-tools/bin/as.exe
LD=/opt/gcc-tools/bin/ld.exe LD_FOR_TARGET=/opt/gcc-tools/bin/ld.exe
--with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.3.4 20090804 (release) 1 (GCC) 

When compiling a fortran module where an array was declared twice, e.g.

real  foo(2) /2*0.0/
and then
data foo /0.0, 0.0/

I got this error:
f951: internal compiler error: in gfc_assign_data_value_range, at
fortran/data.c:562
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Removing the first data declaration fixed the problem.
I presume you will agree a better error message should be given?


-- 
           Summary: gfortran internal data assignment error cause found
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: harry dot rockefeller at flightsafety dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44177


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

* [Bug fortran/44177] gfortran internal data assignment error cause found
  2010-05-17 20:21 [Bug fortran/44177] New: gfortran internal data assignment error cause found harry dot rockefeller at flightsafety dot com
@ 2010-05-17 20:30 ` kargl at gcc dot gnu dot org
  2010-05-17 20:32 ` kargl at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu dot org @ 2010-05-17 20:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from kargl at gcc dot gnu dot org  2010-05-17 20:29 -------
Given this code

  real foo(2) /2*0.0/
  data foo/0.0, 0.0/  
  print *, foo
  end

Trunk compiles the code.  Gfortran 4.5 has the ICE.

troutmask:sgk[211] gfc4x -o z -Wall t.f90
troutmask:sgk[212] ./z
   0.0000000       0.0000000    
troutmask:sgk[213] gfc45 -o z -Wall t.f90
f951: internal compiler error: in gfc_assign_data_value_range, at
fortran/data.c:562
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

It's unclear to me if the fix in trunk can be back ported to 4.5.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44177


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

* [Bug fortran/44177] gfortran internal data assignment error cause found
  2010-05-17 20:21 [Bug fortran/44177] New: gfortran internal data assignment error cause found harry dot rockefeller at flightsafety dot com
  2010-05-17 20:30 ` [Bug fortran/44177] " kargl at gcc dot gnu dot org
@ 2010-05-17 20:32 ` kargl at gcc dot gnu dot org
  2010-05-17 20:40 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu dot org @ 2010-05-17 20:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kargl at gcc dot gnu dot org  2010-05-17 20:31 -------
BTW, one should consider elimination of the ...

troutmask:sgk[210] gfc4x -o z -Wall -std=f95 t.f90
t.f90:1.13:

real foo(2) /2*0.0/
             1
Error: Extension: Old-style initialization at (1)
t.f90:2.4:

from one's code.


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.4.5 4.5.1
      Known to work|                            |4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44177


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

* [Bug fortran/44177] gfortran internal data assignment error cause found
  2010-05-17 20:21 [Bug fortran/44177] New: gfortran internal data assignment error cause found harry dot rockefeller at flightsafety dot com
  2010-05-17 20:30 ` [Bug fortran/44177] " kargl at gcc dot gnu dot org
  2010-05-17 20:32 ` kargl at gcc dot gnu dot org
@ 2010-05-17 20:40 ` burnus at gcc dot gnu dot org
  2010-05-17 21:10 ` dfranke at gcc dot gnu dot org
  2010-05-17 21:47 ` kargl at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-05-17 20:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2010-05-17 20:39 -------
I can confirm the issue with GCC 4.3.4, 4.4.4, and 4.5.0; however, using 4.6 it
works. I think the ICE has been fixed by the recent constructor work by Daniel.
Thus, one solution is to close the bug as WONTFIX; alternatively, one can check
what is needed to fix the PR.

Work around is to remove one of the initializations as the variable is
initialized twice. Best is to remove the first one as this variant is not
standard conform (the DATA statement is).

 * * *

Side note: With 4.6 and "-pedantic" one gets also the expected warnings:

real  foo(2) /2*0.0/
              1
Warning: Extension: Old-style initialization at (1)
data foo /0.0, 0.0/
             1
Warning: Extension: re-initialization of 'foo' at (1)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.4.5 4.5.1                 |4.3.4 4.4.0 4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44177


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

* [Bug fortran/44177] gfortran internal data assignment error cause found
  2010-05-17 20:21 [Bug fortran/44177] New: gfortran internal data assignment error cause found harry dot rockefeller at flightsafety dot com
                   ` (2 preceding siblings ...)
  2010-05-17 20:40 ` burnus at gcc dot gnu dot org
@ 2010-05-17 21:10 ` dfranke at gcc dot gnu dot org
  2010-05-17 21:47 ` kargl at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-17 21:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dfranke at gcc dot gnu dot org  2010-05-17 21:10 -------
The PR(In reply to comment #3)
> I think the ICE has been fixed by the recent constructor work by Daniel.

That was PR24978. Given that this PR was opened against 4.1 in 2005 and a
simple workaround exists (fix your code, i.e. eliminate all double
initializations), I don't see much reason for backport. Further, the
constructor work is a serious change, I wouldn't want to backport that for so
little. 

Suggest to close as dupe of PR24978.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44177


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

* [Bug fortran/44177] gfortran internal data assignment error cause found
  2010-05-17 20:21 [Bug fortran/44177] New: gfortran internal data assignment error cause found harry dot rockefeller at flightsafety dot com
                   ` (3 preceding siblings ...)
  2010-05-17 21:10 ` dfranke at gcc dot gnu dot org
@ 2010-05-17 21:47 ` kargl at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu dot org @ 2010-05-17 21:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from kargl at gcc dot gnu dot org  2010-05-17 21:46 -------
Pull the trigger for Daniel and mark this as a duplicate.

Harry, thanks for the report.  The bug is fixed in gcc
trunk, which will become 4.6.0 someday.  If you can't 
fix the code (which is recommended), then you'll need
to upgrade to a newer gfortran available from the
gfortran wiki.

*** This bug has been marked as a duplicate of 24978 ***


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44177


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

end of thread, other threads:[~2010-05-17 21:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-17 20:21 [Bug fortran/44177] New: gfortran internal data assignment error cause found harry dot rockefeller at flightsafety dot com
2010-05-17 20:30 ` [Bug fortran/44177] " kargl at gcc dot gnu dot org
2010-05-17 20:32 ` kargl at gcc dot gnu dot org
2010-05-17 20:40 ` burnus at gcc dot gnu dot org
2010-05-17 21:10 ` dfranke at gcc dot gnu dot org
2010-05-17 21:47 ` kargl at gcc dot gnu dot org

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).