[Bug fortran/24755] [4.0/4.1 Regression] internal compiler error with statement function

2005-11-12 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.0.3


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



[Bug fortran/24755] [4.0/4.1 Regression] internal compiler error with statement function

2005-11-10 Thread pault at gcc dot gnu dot org


--- Comment #7 from pault at gcc dot gnu dot org  2005-11-11 05:42 ---
Fixed on mainline and 4.0


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug fortran/24755] [4.0/4.1 Regression] internal compiler error with statement function

2005-11-10 Thread pault at gcc dot gnu dot org


--- Comment #6 from pault at gcc dot gnu dot org  2005-11-11 05:37 ---
Subject: Bug 24755

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  <[EMAIL PROTECTED]>

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  <[EMAIL PROTECTED]>

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=24755



[Bug fortran/24755] [4.0/4.1 Regression] internal compiler error with statement function

2005-11-10 Thread pault at gcc dot gnu dot org


--- Comment #5 from pault at gcc dot gnu dot org  2005-11-10 22:24 ---
Subject: Bug 24755

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  <[EMAIL PROTECTED]>

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  <[EMAIL PROTECTED]>

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=24755



[Bug fortran/24755] [4.0/4.1 Regression] internal compiler error with statement function

2005-11-10 Thread paul dot richard dot thomas at cea dot fr


--- Comment #4 from paul dot richard dot thomas at cea dot fr  2005-11-10 
10:32 ---
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 -  1.47
--- gcc/gcc/fortran/match.c 10 Nov 2005 10:29:15 -
*** 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 -  1.1
--- gcc/gcc/testsuite/gfortran.dg/recursive_statement_functions.f90 10 Nov
2005 10:28:58 -
***
*** 1,16 
  ! { dg-do compile }
  ! PR20866 - A statement function cannot be recursive.
  ! Contributed by Joost VandeVondele <[EMAIL PROTECTED]>
!   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 <[EMAIL PROTECTED]>
! !
! ! Modified 20051110 to check that regressions PR24655 and PR24755
! ! are fixed. Thanks to [EMAIL PROTECTED] and [EMAIL PROTECTED] 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=24755



[Bug fortran/24755] [4.0/4.1 Regression] internal compiler error with statement function

2005-11-09 Thread tobi at gcc dot gnu dot org


--- Comment #3 from tobi at gcc dot gnu dot org  2005-11-09 18:40 ---
*** Bug 24655 has been marked as a duplicate of this bug. ***


-- 

tobi at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pavarini at pv dot infn dot
   ||it


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



[Bug fortran/24755] [4.0/4.1 Regression] internal compiler error with statement function

2005-11-09 Thread pault at gcc dot gnu dot org


--- Comment #2 from pault at gcc dot gnu dot org  2005-11-09 13:17 ---
Since recursive_stmt_fcn is involved, this looks like my doing!

I'll take a look tomorrow morning.

Paul T


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pault at gcc dot gnu dot org


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



[Bug fortran/24755] [4.0/4.1 Regression] internal compiler error with statement function

2005-11-09 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2005-11-09 11:44 ---
Confirmed, backtrace:
#0  0x080727d3 in recursive_stmt_fcn (e=0x9fec3b8, sym=0x9fec218) at
/home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/match.c:2727
#1  0x080727b5 in recursive_stmt_fcn (e=0x9fec540, sym=0x9fec218) at
/home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/match.c:2744
#2  0x080727b5 in recursive_stmt_fcn (e=0x9fec818, sym=0x9fec218) at
/home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/match.c:2744
#3  0x080727b5 in recursive_stmt_fcn (e=0x9fecb70, sym=0x9fec218) at
/home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/match.c:2744
#4  0x080727b5 in recursive_stmt_fcn (e=0x9fecbc8, sym=0x9fec218) at
/home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/match.c:2744
#5  0x08074349 in gfc_match_st_function () at
/home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/match.c:2819
#6  0x0807c2ba in match_word (str=, subr=0x8074270
, old_locus=0xbfdffc08)
at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/parse.c:65
#7  0x0807c3ac in decode_statement () at
/home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/parse.c:132
#8  0x0807cda5 in next_statement () at
/home/peshtigo/pinskia/src/gnu/gcc/src/gcc/fortran/parse.c:356
#


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
  Known to fail||4.1.0 4.0.3
  Known to work||4.0.1
   Last reconfirmed|-00-00 00:00:00 |2005-11-09 11:44:05
   date||
Summary|internal compiler error with|[4.0/4.1 Regression]
   |statement function  |internal compiler error with
   ||statement function


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