[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

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


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.1.0


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




[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-12-28 Thread pault at gcc dot gnu dot org


--- Comment #10 from pault at gcc dot gnu dot org  2005-12-29 06:18 ---
Subject: Bug 19362

Author: pault
Date: Thu Dec 29 06:18:23 2005
New Revision: 109139

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=109139
Log:
2005-12-29  Paul Thomas  [EMAIL PROTECTED]

PR fortran/25532
* trans-types.c (copy_dt_decls_ifequal): Copy declarations for
components of derived type components by recursing into
gfc_get_derived_type.

2005-12-29  Paul Thomas  [EMAIL PROTECTED]

PR fortran/25532
*gfortran.dg/host_used_types_1.f90: Check that host associated
derived type components of derived types are properly declared
in contained procedures.

The following tests were not added on the 2005-12-26 commit.

PR fortran/20889
* gfortran.dg/pointer_component_type_1.f90: New test.

PR fortran/25018
* gfortran.dg/initialization_1.f90: New test.

PR fortran/19362
PR fortran/20244
PR fortran/20864
PR fortran/25391
* gfortran.dg/used_dummy_types_1.f90: New test.
* gfortran.dg/used_dummy_types_2.f90: New test.
* gfortran.dg/used_dummy_types_3.f90: New test.
* gfortran.dg/used_dummy_types_4.f90: New test.
* gfortran.dg/used_dummy_types_5.f90: New test.

PR fortran/23152
* gfortran.dg/assumed_shape_nml.f90: New test.
* gfortran.dg/assumed_size_nml.f90: New test.

PR fortran/20862
PR fortran/25053
PR fortran/25063
PR fortran/25064
PR fortran/25066
PR fortran/25067
PR fortran/25068
PR fortran/25307
* gfortran.dg/io_constraints_1.f90: New test.
* gfortran.dg/io_constraints_1.f90: New test.

Added:
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/assumed_shape_nml.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/assumed_size_nml.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/host_used_types_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/initialization_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/io_constraints_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/io_constraints_2.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/pointer_component_type_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/used_dummy_types_1.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/used_dummy_types_2.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/used_dummy_types_3.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/used_dummy_types_4.f90
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/used_dummy_types_5.f90
Modified:
branches/gcc-4_1-branch/gcc/fortran/ChangeLog
branches/gcc-4_1-branch/gcc/fortran/trans-types.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-12-26 Thread pault at gcc dot gnu dot org


--- Comment #8 from pault at gcc dot gnu dot org  2005-12-26 09:07 ---
Subject: Bug 19362

Author: pault
Date: Mon Dec 26 09:07:27 2005
New Revision: 109061

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=109061
Log:
2005-12-26  Paul Thomas  [EMAIL PROTECTED]

PR fortran/20889
*resolve.c(resolve_structure_cons): Do not attempt to convert
the type of mismatched pointer type components, except when
the constructor component is BT_UNKNOWN; emit error instead.

PR fortran/25018
* expr.c (check_inquiry): Return FAILURE if there is no symtree to
provide a name. Error/warning for assumed character length argument
to LEN for an initialization expression, using GFC_GNU_STD. Add an
argument to flag that the expression is not restricted.
(check_init_expr): Improve the message for a failing variable.
(gfc_match_init_expr): Call check_enquiry again to make sure that
unsimplified expressions are not causing unnecessary errors.

PR fortran/19362
PR fortran/20244
PR fortran/20864
PR fortran/25391
* interface.c (gfc_compare_types): Broken into two.
(gfc_compare_derived_types): Second half of gfc_compare_types with
corrections for a missing check that module name is non-NULL and
a check for private components.
* symbol.c (gfc_free_dt_list): New function.
(gfc_free_namespace): Call gfc_free_dt_list.
* resolve.c (resolve_symbol): Build the list of derived types in the
symbols namespace.
* gfortran.h: Define the structure type gfc_dt_list.  Add a new field,
derived_types to gfc_namespace.  Provide a prototye for the new
function gfc_compare_derived_types.
* trans_types.c (gfc_get_derived_type): Test for the derived type being
available in the host namespace. In this case, the host backend
declaration is used for the structure and its components.  If an
unbuilt, equal structure that is not use associated is found in the
host namespace, build it there and then.  On exit,traverse the
namespace of the derived type to see if there are equal but unbuilt.
If so, copy the structure and its component declarations.
(copy_dt_decls_ifequal): New functions to copy declarations to other
equal structure types.

PR fortran/20862
* io.c (gfc_match_format): Make the appearance of a format statement
in a module specification block an error.

PR fortran/23152
* match.c (gfc_match_namelist): Set assumed shape arrays in
namelists as std=GFC_STD_GNU and assumed size arrays as an
unconditional error.

PR fortran/25069
* match.c (gfc_match_namelist): Set the respecification of a USE
associated namelist group as std=GFC_STD_GNU.  Permit the concatenation
on no error.

PR fortran/25053
PR fortran/25063
PR fortran/25064
PR fortran/25066
PR fortran/25067
PR fortran/25068
PR fortran/25307
* io.c (resolve_tag): Change std on IOSTAT != default integer to
GFC_STD_GNU and change message accordingly.  Add same error for
SIZE.
(match_dt_element, gfortran.h): Add field err_where to gfc_dt and
set it when tags are being matched.
(gfc_resolve_dt): Remove tests that can be done before resolution
and add some of the new ones here.
(check_io_constraints): New function that checks for most of the
data transfer constraints. Some of these were previously done in
match_io, from where this function is called, and some were done
in gfc_resolve_dt.
(match_io): Remove most of the tests of constraints and add the
call to check_io_constraints.

2005-12-26  Paul Thomas  [EMAIL PROTECTED]

PR fortran/20889
* gfortran.dg/pointer_component_type_1.f90: New test.

PR fortran/25018
* gfortran.dg/initialization_1.f90: New test.
* gfortran.dg/enum_5.f90: Change dg-error to new message.
* gfortran.dg/g77/980616-0.f: The same.

PR fortran/19362
PR fortran/20244
PR fortran/20864
PR fortran/25391
*gfortran.dg/used_dummy_types_1.f90: New test.
*gfortran.dg/used_dummy_types_2.f90: New test.
*gfortran.dg/used_dummy_types_3.f90: New test.
*gfortran.dg/used_dummy_types_4.f90: New test.
*gfortran.dg/used_dummy_types_5.f90: New test.

PR fortran/23152
* gfortran.dg/namelist_use.f90: Add trap for warning on NAMELIST
group already being USE associated.
* gfortran.dg/assumed_shape_nml.f90: New test.
* gfortran.dg/assumed_size_nml.f90: New test.

PR fortran/20862
PR fortran/25053
PR fortran/25063
PR fortran/25064
PR fortran/25066
PR fortran/25067

[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-12-26 Thread pault at gcc dot gnu dot org


--- Comment #9 from pault at gcc dot gnu dot org  2005-12-26 09:10 ---
Fixed on trunk and 4.1


-- 

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



[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-12-21 Thread pault at gcc dot gnu dot org


--- Comment #7 from pault at gcc dot gnu dot org  2005-12-22 07:05 ---
Subject: Bug 19362

Author: pault
Date: Thu Dec 22 07:05:22 2005
New Revision: 108943

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=108943
Log:
2005-12-22  Paul Thomas  [EMAIL PROTECTED]

PR fortran/20889
*resolve.c(resolve_structure_cons): Do not attempt to convert
the type of mismatched pointer type components, except when
the constructor component is BT_UNKNOWN; emit error instead.

PR fortran/25029
PR fortran/21256
*resolve.c(check_assumed_size_reference): New function to check for
upper
bound in assumed size array references.
(resolve_assumed_size_actual): New function to do a very restricted
scan
of actual argument expressions of those procedures for which incomplete
assumed size array references are not allowed.
(resolve_function, resolve_call): Switch off assumed size checking of
actual arguments, except for elemental procedures and array valued
intrinsics; excepting LBOUND.
(resolve_variable): Call check_assumed_size_reference.

PR fortran/19362
PR fortran/20244
PR fortran/20864
PR fortran/25391
*interface.c(gfc_compare_types): Broken into two.
(gfc_compare_derived_types): Second half of gfc_compare_types with
corrections for a missing check that module name is non-NULL and
a check for private components.
*symbol.c(gfc_free_dt_list): New function.
(gfc_free_namespace): Call gfc_free_dt_list.
*resolve.c(resolve_symbol): Build the list of derived types in the
symbols namespace.
*gfortran.h: Define the structure type gfc_dt_list.  Add a new field,
derived_types to gfc_namespace.  Provide a prototye for the new
function gfc_compare_derived_types.
*trans_types.c(gfc_get_derived_type): Test for the derived type being
available in the host namespace. In this case, the host backend
declaration is used for the structure and its components.  If an
unbuilt, equal structure that is not use associated is found in the
host namespace, build it there and then.  On exit,traverse the
namespace of the derived type to see if there are equal but unbuilt.
If so, copy the structure and its component declarations.
(copy_dt_decls_ifequal): New functions to copy declarations to other
equal structure types.

PR fortran/20862
* io.c (gfc_match_format): Make the appearance of a format statement
in a module specification block an error.

PR fortran/23152
* match.c (gfc_match_namelist): Set assumed shape arrays in
namelists as std=GFC_STD_GNU and assumed size arrays as an
unconditional error.

PR fortran/25069
* match.c (gfc_match_namelist): Set the respecification of a USE
associated namelist group as std=GFC_STD_GNU.  Permit the concatenation
on no error.

PR fortran/25053
PR fortran/25063
PR fortran/25064
PR fortran/25066
PR fortran/25067
PR fortran/25068
PR fortran/25307
* io.c (resolve_tag): Change std on IOSTAT != default integer to
GFC_STD_GNU and change message accordingly.  Add same error for
SIZE.
(match_dt_element, gfortran.h): Add field err_where to gfc_dt and
set it when tags are being matched.
(gfc_resolve_dt): Remove tests that can be done before resolution
and add some of the new ones here.
(check_io_constraints): New function that checks for most of the
data transfer constraints. Some of these were previously done in
match_io, from where this function is called, and some were done
in gfc_resolve_dt.
(match_io): Remove most of the tests of constraints and add the
call to check_io_constraints.

2005-12-22  Paul Thomas  [EMAIL PROTECTED]

PR fortran/20889
*gfortran.dg/pointer_component_type_1.f90: New test.

PR fortran/25029
PR fortran/21256
*gfortran.dg/assumed_size_refs.f90: New test for the conditions that
should give an error with assumed size array refernces and checks those
that should not.
*gfortran.dg/gfortran.dg/pr15140.f90: Give the assumed size array
reference an upper bound so that it does not generate an error.

PR fortran/19362
PR fortran/20244
PR fortran/20864
PR fortran/25391
*gfortran.dg/used_dummy_types_1.f90: New test.
*gfortran.dg/used_dummy_types_2.f90: New test.
*gfortran.dg/used_dummy_types_3.f90: New test.
*gfortran.dg/used_dummy_types_4.f90: New test.
*gfortran.dg/used_dummy_types_5.f90: New test.

PR fortran/23152
*gfortran.dg/namelist_use.f90: Add trap for warning on NAMELIST
group 

[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-07-20 Thread steven at gcc dot gnu dot org

--- Additional Comments From steven at gcc dot gnu dot org  2005-07-21 
00:55 ---
The code of the original reporter is in fact not valid. 
 
From the Fortran 95 standard: 
 
Section 4.4.2: Two data entities have the same type if they are declared with 
reference to the same derived-type definition. 
 
Not the case here. 
 
...Data entities in different scoping units also have the same type if they 
are declared with reference to different derived-type definitions that have 
the same name (...) 
 
Also not the case here. 
 
So the types of BAR and BAZ are not the same. 
 
 
Section 7.5.1.2: An intrinsic assignment statement is an assignment statement 
where the shapes of variable and expr conform and where (...) [t]he types of 
variable and expr are of the same derived type and no defined assignment 
exists for objects of this type. 
 
In this the types of variable (BAZ) and expr (BAR) are not the same, and there 
is no defined assignment from T0 to T1.  So the code is not legal Fortran. 
 
Now, whether we should support this anyway is a different matter... 
 

-- 


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


[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-04-07 Thread arnold dot moene at wur dot nl

--- Additional Comments From arnold dot moene at wur dot nl  2005-04-07 
22:44 ---
The following (4 files :( ) example from the WRF weather model seems to be
related. I can't see if it is really triggered by the same bug:

prompt cat ESMF_TimeInterval.f
  module ESMF_TimeIntervalMod
  implicit none
  private
  type ESMF_TimeInterval
  sequence   ! match C++ storage order
integer:: YR ! calendar interval number of days
  end type
  public ESMF_TimeInterval
  end module ESMF_TimeIntervalMod
prompt cat ESMF_Time.f
  module ESMF_TimeMod
  use ESMF_TimeIntervalMod
  implicit none
  private
  type ESMF_Time
   sequence
   integer :: DD
  end type
  public ESMF_Time

  public operator(+)
  private ESMF_TimeInc

  interface operator(+)
   module procedure ESMF_TimeInc
  end interface

  contains

  function ESMF_TimeInc(time, timeinterval)
  type(ESMF_Time) :: ESMF_TimeInc
  type(ESMF_Time), intent(in) :: time
  type(ESMF_TimeInterval), intent(in) :: timeinterval
! Do nothing
  end function ESMF_TimeInc

  end module ESMF_TimeMod

prompt cat ESMF_Alarm.f
  module ESMF_AlarmMod

  use ESMF_TimeIntervalMod, only : ESMF_TimeInterval
  use ESMF_TimeMod, only : ESMF_Time

  implicit none

  type ESMF_Alarm
  sequence
type(ESMF_TimeInterval) :: RingInterval
type(ESMF_Time)  :: PrevRingTime
  end type ESMF_Alarm


  public ESMF_Alarm

  end module ESMF_AlarmMod

prompt cat ESMF_Clock.f
  module ESMF_ClockMod

  use ESMF_AlarmMod

  contains

  subroutine ESMF_ClockAdvance()
use ESMF_TimeMod
type(ESMF_Alarm) :: alarm
alarm%PrevRingTime = alarm%PrevRingTime + alarm%RingInterval
  end subroutine ESMF_ClockAdvance

  end module ESMF_ClockMod

Attempt to compile gives:

prompt gfortran -c ESMF_TimeInterval.f ESMF_Time.f ESMF_Alarm.f ESMF_Clock.f
Warning: ESMF_TimeInterval.f:6: Line is being truncated
ESMF_Time.f: In function 'esmf_timeinc':
ESMF_Time.f:12: warning: unused variable 'timeinterval'
ESMF_Time.f:12: warning: unused variable 'time'
ESMF_Time.f:12: warning: Function return value not set
ESMF_Time.f:12: warning: control reaches end of non-void function
ESMF_Clock.f: In function 'esmf_clockadvance':
ESMF_Clock.f:7: internal compiler error: in fold_convert, at fold-const.c:2002
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://gcc.gnu.org/bugs.html for instructions.

gfortran is recently downloaded prebuilt version:

prompt gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --enable-languages=c,f95
--prefix=/home/work/gfortran/build/irun
Thread model: posix
gcc version 4.1.0 20050314 (experimental)


-- 


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


[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-03-03 Thread coudert at clipper dot ens dot fr

--- Additional Comments From coudert at clipper dot ens dot fr  2005-03-03 
10:37 ---
Hi,

I see this patch hasn't been commited yet, could you please send it again to the
mailing-lists? With the new approval rules, maybe it should hopefully get
reviewed...

-- 


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


[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-01-19 Thread coudert at clipper dot ens dot fr

--- Additional Comments From coudert at clipper dot ens dot fr  2005-01-19 
12:37 ---
As this bug is blocking some of my code, I did some testing of the patch
provided in comment #2. Bootstrapped and no additional regression on
sparc-sun-solaris2.9. It fixes the testcase all right. Thanks!

-- 


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


[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-01-13 Thread rakdver at gcc dot gnu dot org

--- Additional Comments From rakdver at gcc dot gnu dot org  2005-01-13 
22:55 ---
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00761.html

-- 
   What|Removed |Added

   Keywords||patch


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


[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-01-11 Thread rakdver at gcc dot gnu dot org


-- 
   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |rakdver at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED


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


[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998

2005-01-10 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-10 
15:16 ---
Confirmed, might be related to PR 18157.

-- 
   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed||1
   Keywords||ice-on-valid-code
   Last reconfirmed|-00-00 00:00:00 |2005-01-10 15:16:31
   date||


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