public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/28237] New: recursive fuction causes ICE
@ 2006-07-03 17:42 buraphalinuxserver at gmail dot com
2006-07-03 18:27 ` [Bug fortran/28237] " pinskia at gcc dot gnu dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: buraphalinuxserver at gmail dot com @ 2006-07-03 17:42 UTC (permalink / raw)
To: gcc-bugs
recursive function causes ICE
--------------
program r
implicit none
integer :: i=5
print fact(i)
stop
end
recursive function fact(n) result(nfact)
implicit none
integer, intent(in) :: n
integer :: nfact
if (n>0) then
nfact = n * fact(n-1)
else
nfact = 1
end if
end function fact
end
--------------------
gfortran -vUsing built-in specs.
Target: i586-pc-linux-gnu
Configured with: /tmp/gcc-4.0.3/configure --prefix=/usr --enable-shared
--enable-threads=posix --enable-__cxa_atexit --with-gnu-as --with-gnu-ld
--verbose --enable-languages=c,c++,f95 --disable-nls --disable-rpath
--build=i586-pc-linux-gnu --target=i586-pc-linux-gnu --host=i586-pc-linux-gnu
Thread model: posix
gcc version 4.0.3
--------------------
even if the code is invalid, it should not result in an ICE
--
Summary: recursive fuction causes ICE
Product: gcc
Version: 4.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: buraphalinuxserver at gmail dot com
GCC build triplet: i586-linux-gnu
GCC host triplet: i586-linux-gnu
GCC target triplet: i586-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28237
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/28237] recursive fuction causes ICE
2006-07-03 17:42 [Bug fortran/28237] New: recursive fuction causes ICE buraphalinuxserver at gmail dot com
@ 2006-07-03 18:27 ` pinskia at gcc dot gnu dot org
2006-07-03 18:29 ` [Bug fortran/28237] print call() pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-03 18:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-07-03 18:26 -------
Confirmed, related to PR 23420.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |23420
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-07-03 18:26:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28237
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/28237] print call()
2006-07-03 17:42 [Bug fortran/28237] New: recursive fuction causes ICE buraphalinuxserver at gmail dot com
2006-07-03 18:27 ` [Bug fortran/28237] " pinskia at gcc dot gnu dot org
@ 2006-07-03 18:29 ` pinskia at gcc dot gnu dot org
2006-07-05 9:47 ` paul dot richard dot thomas at cea dot fr
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-03 18:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-07-03 18:28 -------
This has nothing to do with recursive functions, reduced testcase:
program r
implicit none
print fact()
stop
contains
function fact() result(nfact)
implicit none
integer :: nfact
end function fact
end
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|recursive fuction causes ICE|print call()
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28237
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/28237] print call()
2006-07-03 17:42 [Bug fortran/28237] New: recursive fuction causes ICE buraphalinuxserver at gmail dot com
2006-07-03 18:27 ` [Bug fortran/28237] " pinskia at gcc dot gnu dot org
2006-07-03 18:29 ` [Bug fortran/28237] print call() pinskia at gcc dot gnu dot org
@ 2006-07-05 9:47 ` paul dot richard dot thomas at cea dot fr
2006-07-06 14:21 ` pault at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2006-07-05 9:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from paul dot richard dot thomas at cea dot fr 2006-07-05 09:47 -------
Created an attachment (id=11825)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11825&action=view)
Fix for PR28237 and the last bit of PR2320.
I have not had time to do a full regtest; just gfortran.dg/print*, which
includes the following testcase (print_fmt_5.f90):
Paul
! { dg-do compile }
! print_fmt_5.f90
! Test of fix for PR28237 and the last bit of PR2320. See
! below for the description of the problem.
!
program r
character(12) :: for = '(i5)', left = '(i', right = ')'
integer :: i, j
integer :: h(4) &
= (/1h(, 1hi, 1h5, 1h)/)! { dg-warning "HOLLERITH|Hollerith" }
namelist /mynml/ i
i = fact ()
!
! All these are "legal" things to do; note however the warnings
! for extensions or obsolete features!
!
print *, fact()
print 100, fact()
print '(i5)', fact()
print mynml ! { dg-warning "is an extension" }
do i = 1, 5
print trim(left)//char(iachar('0') + i)//trim(right), i
end do
assign 100 to i ! { dg-warning "ASSIGN statement" }
print i, fact() ! { dg-warning "ASSIGNED variable" }
print h, fact () ! { dg-warning "Non-character in FORMAT" }
!
! These are not and caused a segfault in trans-io:560
!
! PR28237
print fact() ! { dg-error "not an ASSIGNED variable" }
! original PR23420
print precision(1.2_8) ! { dg-error "type default CHARACTER" }
! PR23420 points 4 and 5
print j + j ! { dg-error "not an ASSIGNED variable" }
! An extension of the above, encountered in writing the fix
write (*, fact())! { dg-error "not an ASSIGNED variable" }
100 format (i5)
contains
function fact()
integer :: fact
fact = 1
end function fact
end
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28237
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/28237] print call()
2006-07-03 17:42 [Bug fortran/28237] New: recursive fuction causes ICE buraphalinuxserver at gmail dot com
` (2 preceding siblings ...)
2006-07-05 9:47 ` paul dot richard dot thomas at cea dot fr
@ 2006-07-06 14:21 ` pault at gcc dot gnu dot org
2006-07-06 16:20 ` patchapp at dberlin dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-07-06 14:21 UTC (permalink / raw)
To: gcc-bugs
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28237
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/28237] print call()
2006-07-03 17:42 [Bug fortran/28237] New: recursive fuction causes ICE buraphalinuxserver at gmail dot com
` (3 preceding siblings ...)
2006-07-06 14:21 ` pault at gcc dot gnu dot org
@ 2006-07-06 16:20 ` patchapp at dberlin dot org
2006-07-07 4:47 ` pault at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: patchapp at dberlin dot org @ 2006-07-06 16:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from patchapp at dberlin dot org 2006-07-06 16:20 -------
Subject: Bug number PR28237
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00245.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28237
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/28237] print call()
2006-07-03 17:42 [Bug fortran/28237] New: recursive fuction causes ICE buraphalinuxserver at gmail dot com
` (4 preceding siblings ...)
2006-07-06 16:20 ` patchapp at dberlin dot org
@ 2006-07-07 4:47 ` pault at gcc dot gnu dot org
2006-07-07 5:09 ` pault at gcc dot gnu dot org
2006-07-07 5:16 ` pault at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-07-07 4:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pault at gcc dot gnu dot org 2006-07-07 04:47 -------
Subject: Bug 28237
Author: pault
Date: Fri Jul 7 04:47:24 2006
New Revision: 115246
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115246
Log:
2006-07-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28237
PR fortran/23420
* io.c (resolve_tag): Any integer that is not an assigned
variable is an error.
2006-07-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28237
PR fortran/23420
* gfortran.dg/print_fmt_5.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/print_fmt_5.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/io.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28237
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/28237] print call()
2006-07-03 17:42 [Bug fortran/28237] New: recursive fuction causes ICE buraphalinuxserver at gmail dot com
` (5 preceding siblings ...)
2006-07-07 4:47 ` pault at gcc dot gnu dot org
@ 2006-07-07 5:09 ` pault at gcc dot gnu dot org
2006-07-07 5:16 ` pault at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-07-07 5:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pault at gcc dot gnu dot org 2006-07-07 05:09 -------
Subject: Bug 28237
Author: pault
Date: Fri Jul 7 05:08:57 2006
New Revision: 115247
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115247
Log:
2006-07-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28237
PR fortran/23420
* io.c (resolve_tag): Any integer that is not an assigned
variable is an error.
2006-07-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28237
PR fortran/23420
* gfortran.dg/print_fmt_5.f90: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/print_fmt_5.f90
Modified:
branches/gcc-4_1-branch/gcc/fortran/ChangeLog
branches/gcc-4_1-branch/gcc/fortran/io.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28237
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug fortran/28237] print call()
2006-07-03 17:42 [Bug fortran/28237] New: recursive fuction causes ICE buraphalinuxserver at gmail dot com
` (6 preceding siblings ...)
2006-07-07 5:09 ` pault at gcc dot gnu dot org
@ 2006-07-07 5:16 ` pault at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-07-07 5:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pault at gcc dot gnu dot org 2006-07-07 05:16 -------
Fixedon trunk and 4.1
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28237
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-07-07 5:16 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-03 17:42 [Bug fortran/28237] New: recursive fuction causes ICE buraphalinuxserver at gmail dot com
2006-07-03 18:27 ` [Bug fortran/28237] " pinskia at gcc dot gnu dot org
2006-07-03 18:29 ` [Bug fortran/28237] print call() pinskia at gcc dot gnu dot org
2006-07-05 9:47 ` paul dot richard dot thomas at cea dot fr
2006-07-06 14:21 ` pault at gcc dot gnu dot org
2006-07-06 16:20 ` patchapp at dberlin dot org
2006-07-07 4:47 ` pault at gcc dot gnu dot org
2006-07-07 5:09 ` pault at gcc dot gnu dot org
2006-07-07 5:16 ` pault 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).