public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/24655] New: bug compiling following few lines code with gfortran
@ 2005-11-03 14:43 pavarini at pv dot infn dot it
2005-11-03 15:39 ` [Bug fortran/24655] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: pavarini at pv dot infn dot it @ 2005-11-03 14:43 UTC (permalink / raw)
To: gcc-bugs
Code follows
program dumm
implicit none
integer :: n
double precision :: fi
double precision, parameter :: one=1d0
! Statement functions
fi(n)=n *one
write(6,*) fi(10)
stop
end
The compiler yields
t.f90:0: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
--
Summary: bug compiling following few lines code with gfortran
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pavarini at pv dot infn dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24655
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/24655] bug compiling following few lines code with gfortran
2005-11-03 14:43 [Bug fortran/24655] New: bug compiling following few lines code with gfortran pavarini at pv dot infn dot it
@ 2005-11-03 15:39 ` pinskia at gcc dot gnu dot org
2005-11-09 18:40 ` [Bug fortran/24655] ICE with statement function tobi at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-03 15:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-11-03 15:39 -------
Confirmed, backtrace:
#0 0x000000000042bc4a in recursive_stmt_fcn (e=0xc08160, sym=0xc07d40)
at /home/pinskia/src/newtest/trunk/gcc/fortran/match.c:2727
#1 0x000000000042bc25 in recursive_stmt_fcn (e=0xc08420, sym=0xc07d40)
at /home/pinskia/src/newtest/trunk/gcc/fortran/match.c:2744
#2 0x000000000042d8f0 in gfc_match_st_function () at
/home/pinskia/src/newtest/trunk/gcc/fortran/match.c:2819
#3 0x00000000004359f3 in match_word (str=Variable "str" is not available.
) at /home/pinskia/src/newtest/trunk/gcc/fortran/parse.c:65
#4 0x0000000000435b01 in decode_statement () at
/home/pinskia/src/newtest/trunk/gcc/fortran/parse.c:132
#5 0x0000000000436564 in next_statement () at
/home/pinskia/src/newtest/trunk/gcc/fortran/parse.c:358
#6 0x00000000004376e2 in parse_spec (st=ST_DATA_DECL) at
/home/pinskia/src/newtest/trunk/gcc/fortran/parse.c:1601
#7 0x0000000000437d36 in parse_progunit (st=ST_ARITHMETIC_IF) at
/home/pinskia/src/newtest/trunk/gcc/fortran/parse.c:2305
#8 0x00000000004382dd in gfc_parse_file () at
/home/pinskia/src/newtest/trunk/gcc/fortran/parse.c:2595
#9 0x00000000004518de in gfc_be_parse_file (set_yydebug=Variable "set_yydebug"
is not available.
) at /home/pinskia/src/newtest/trunk/gcc/fortran/f95-lang.c:286
#10 0x0000000000719e73 in toplev_main (argc=Variable "argc" is not available.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2005-11-03 15:39:09
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24655
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/24655] ICE with statement function
2005-11-03 14:43 [Bug fortran/24655] New: bug compiling following few lines code with gfortran pavarini at pv dot infn dot it
2005-11-03 15:39 ` [Bug fortran/24655] " pinskia at gcc dot gnu dot org
@ 2005-11-09 18:40 ` tobi at gcc dot gnu dot org
2005-11-10 10:34 ` paul dot richard dot thomas at cea dot fr
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-11-09 18:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from tobi at gcc dot gnu dot org 2005-11-09 18:40 -------
*** This bug has been marked as a duplicate of 24755 ***
--
tobi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tobi at gcc dot gnu dot org
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24655
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/24655] ICE with statement function
2005-11-03 14:43 [Bug fortran/24655] New: bug compiling following few lines code with gfortran pavarini at pv dot infn dot it
2005-11-03 15:39 ` [Bug fortran/24655] " pinskia at gcc dot gnu dot org
2005-11-09 18:40 ` [Bug fortran/24655] ICE with statement function tobi at gcc dot gnu dot org
@ 2005-11-10 10:34 ` paul dot richard dot thomas at cea dot fr
2005-11-10 22:24 ` pault at gcc dot gnu dot org
2005-11-11 5:37 ` pault at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2005-11-10 10:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from paul dot richard dot thomas at cea dot fr 2005-11-10 10:34 -------
I have a patch for this, which is regtesting now and will be submitted at
lunchtime.
Apologies for letting this regression through; please give the patch a try.
Paul T
Index: gcc/gcc/fortran/match.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/match.c,v
retrieving revision 1.47
diff -c -p -r1.47 match.c
*** gcc/gcc/fortran/match.c 17 Oct 2005 20:52:36 -0000 1.47
--- gcc/gcc/fortran/match.c 10 Nov 2005 10:29:15 -0000
*************** recursive_stmt_fcn (gfc_expr *e, gfc_sym
*** 2721,2727 ****
if (sym->name == arg->name
|| recursive_stmt_fcn (arg->expr, sym))
return true;
! }
/* Check the name before testing for nested recursion! */
if (sym->name == e->symtree->n.sym->name)
--- 2721,2730 ----
if (sym->name == arg->name
|| recursive_stmt_fcn (arg->expr, sym))
return true;
! }
!
! if (e->symtree == NULL)
! return false;
/* Check the name before testing for nested recursion! */
if (sym->name == e->symtree->n.sym->name)
*************** recursive_stmt_fcn (gfc_expr *e, gfc_sym
*** 2736,2742 ****
break;
case EXPR_VARIABLE:
! if (sym->name == e->symtree->n.sym->name)
return true;
break;
--- 2739,2745 ----
break;
case EXPR_VARIABLE:
! if (e->symtree && sym->name == e->symtree->n.sym->name)
return true;
break;
Index: gcc/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90
===================================================================
RCS file:
/cvsroot/gcc/gcc/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90,v
retrieving revision 1.1
diff -c -p -r1.1 recursive_statement_functions.f90
*** gcc/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90 17 Oct
2005 20:52:37 -0000 1.1
--- gcc/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90 10 Nov
2005 10:28:58 -0000
***************
*** 1,16 ****
! { dg-do compile }
! PR20866 - A statement function cannot be recursive.
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
! INTEGER :: i, st1, st2, st3
REAL :: x, z(2,2)
! character*8 :: ch
!
! Test check for recursion via other statement functions, string
! length references, function actual arguments and array index
! references.
! st1(i)=len(ch(st2(1):8))
! st2(i)=max (st3(1), 4)
! st3(i)=2 + cos (z(st1 (1), i)) ! { dg-error "is recursive" }
! write(6,*) st1(1)
END
--- 1,32 ----
! { dg-do compile }
! PR20866 - A statement function cannot be recursive.
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
! !
! ! Modified 20051110 to check that regressions PR24655 and PR24755
! ! are fixed. Thanks to pavarini@pv.infn.it and tdeutsch@cea.fr for
! ! the tests.
! !
! INTEGER :: i, st1, st2, st3, lambda, n
REAL :: x, z(2,2)
! character(8) :: ch
! real(8) :: fi, arg, sigma, dshpfunc
! real(8), parameter :: one=1d0
!
! Test check for recursion via other statement functions, string
! length references, function actual arguments and array index
! references.
! !
! st1 (i) = len (ch(st2 (1):8))
! st2 (i) = max (st3 (1), 4)
! st3 (i) = 2 + cos (z(st1 (1), i)) ! { dg-error "is recursive" }
! !
! ! Test the two regressions.
! !
! fi (n) = n *one
! dshpfunc (arg)=-lambda/sigma*(arg/sigma)**(lambda-1)*exp
(-(arg/sigma)**lambda)
! !
! ! References to each statement function.
! !
! write(6,*) st1 (1), fi (2), dshpfunc (1.0_8)
END
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24655
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/24655] ICE with statement function
2005-11-03 14:43 [Bug fortran/24655] New: bug compiling following few lines code with gfortran pavarini at pv dot infn dot it
` (2 preceding siblings ...)
2005-11-10 10:34 ` paul dot richard dot thomas at cea dot fr
@ 2005-11-10 22:24 ` pault at gcc dot gnu dot org
2005-11-11 5:37 ` pault at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2005-11-10 22:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pault at gcc dot gnu dot org 2005-11-10 22:24 -------
Subject: Bug 24655
Author: pault
Date: Thu Nov 10 22:24:28 2005
New Revision: 106756
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106756
Log:
2005-11-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24655
PR fortran/24755
* match.c (recursive_stmt_fcn): Add checks that symtree exists
for the expression to weed out inline intrinsic functions and
parameters.
PR fortran/24409
* module.c (mio_symtree_ref): Correct the patch of 0923 so that
a symbol is not substituted for by a the symbol for the module
itself and to prevent the promotion of a formal argument.
2005-11-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24655
PR fortran/24755
* gfortran.dg/recursive_statement_functions.f90: Add statement
functions using inline intrinsic functions and parameters to test
that they no longer seg-fault.
PR fortran/24409
gfortran.dg/nested_modules_4.f90: New test.
gfortran.dg/nested_modules_5.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/nested_modules_4.f90
trunk/gcc/testsuite/gfortran.dg/nested_modules_5.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/match.c
trunk/gcc/fortran/module.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24655
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/24655] ICE with statement function
2005-11-03 14:43 [Bug fortran/24655] New: bug compiling following few lines code with gfortran pavarini at pv dot infn dot it
` (3 preceding siblings ...)
2005-11-10 22:24 ` pault at gcc dot gnu dot org
@ 2005-11-11 5:37 ` pault at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2005-11-11 5:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pault at gcc dot gnu dot org 2005-11-11 05:37 -------
Subject: Bug 24655
Author: pault
Date: Fri Nov 11 05:37:40 2005
New Revision: 106779
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106779
Log:
2005-11-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24655
PR fortran/24755
* match.c (recursive_stmt_fcn): Add checks that symtree exists
for the expression to weed out inline intrinsic functions and
parameters.
PR fortran/24409
PR fortran/16861
* module.c (mio_component_ref): Return if the symbol is NULL
and wait for another iteration during module reads.
(mio_symtree_ref): Suppress the writing of contained symbols,
when a symbol is available in the main namespace. Take care that
a symbol is not substituted for by a the symbol for the module
itself and prevent the promotion of a formal argument.
(read_module): Give symbols for variables from contained module
procedures different true_name entries to those from the module
proper.
2005-11-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24655
PR fortran/24755
* gfortran.dg/recursive_statement_functions.f90: Add statement
functions using inline intrinsic functions and parameters to test
that they no longer seg-fault.
PR fortran/24409
* gfortran.dg/nested_modules_4.f90: New test.
* gfortran.dg/nested_modules_5.f90: New test.
PR fortran/16861
* gfortran.dg/nested_modules_3.f90: New test.
* gfortran.dg/nested_modules_2.f90: New test.
Added:
branches/gcc-4_0-branch/gcc/testsuite/gfortran.dg/nested_modules_2.f90
branches/gcc-4_0-branch/gcc/testsuite/gfortran.dg/nested_modules_3.f90
branches/gcc-4_0-branch/gcc/testsuite/gfortran.dg/nested_modules_4.f90
branches/gcc-4_0-branch/gcc/testsuite/gfortran.dg/nested_modules_5.f90
Modified:
branches/gcc-4_0-branch/gcc/fortran/ChangeLog
branches/gcc-4_0-branch/gcc/fortran/match.c
branches/gcc-4_0-branch/gcc/fortran/module.c
branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
branches/gcc-4_0-branch/gcc/testsuite/gfortran.dg/nested_modules_1.f90
branches/gcc-4_0-branch/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24655
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-11-11 5:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-03 14:43 [Bug fortran/24655] New: bug compiling following few lines code with gfortran pavarini at pv dot infn dot it
2005-11-03 15:39 ` [Bug fortran/24655] " pinskia at gcc dot gnu dot org
2005-11-09 18:40 ` [Bug fortran/24655] ICE with statement function tobi at gcc dot gnu dot org
2005-11-10 10:34 ` paul dot richard dot thomas at cea dot fr
2005-11-10 22:24 ` pault at gcc dot gnu dot org
2005-11-11 5:37 ` 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).