[Bug fortran/31550] [regression] f951: segfault in fold-const.c:1963

2007-04-13 Thread dfranke at gcc dot gnu dot org


--- Comment #9 from dfranke at gcc dot gnu dot org  2007-04-13 17:07 ---
*** Bug 31551 has been marked as a duplicate of this bug. ***


-- 


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



[Bug fortran/31550] [regression] f951: segfault in fold-const.c:1963

2007-04-13 Thread pault at gcc dot gnu dot org


--- Comment #8 from pault at gcc dot gnu dot org  2007-04-13 17:03 ---
Fixed.

Phew!

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



[Bug fortran/31550] [regression] f951: segfault in fold-const.c:1963

2007-04-13 Thread pault at gcc dot gnu dot org


--- Comment #7 from pault at gcc dot gnu dot org  2007-04-13 17:02 ---
Subject: Bug 31550

Author: pault
Date: Fri Apr 13 17:01:36 2007
New Revision: 123791

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123791
Log:
2007-04-13  Paul Thomas  <[EMAIL PROTECTED]>

PR fortran/31550
* trans-types.c (copy_dt_decls_ifequal): Do not get pointer
derived type components.

2007-04-13  Paul Thomas  <[EMAIL PROTECTED]>

PR fortran/31550
* gfortran.dg/used_types_16.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/used_types_16.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-types.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/31550] [regression] f951: segfault in fold-const.c:1963

2007-04-13 Thread patchapp at dberlin dot org


--- Comment #6 from patchapp at dberlin dot org  2007-04-13 14:21 ---
Subject: Bug number PR31550

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/2007-04/msg00788.html


-- 


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



[Bug fortran/31550] [regression] f951: segfault in fold-const.c:1963

2007-04-13 Thread pault at gcc dot gnu dot org


--- Comment #5 from pault at gcc dot gnu dot org  2007-04-13 13:32 ---
Daniel,

This turns out to be a problem of carts and horses.  I very rapidly found that
I could fix this problem and break everything else by reversing the order of
the gfc_derived_types list.  After much head scratching, I found that derived
types were picking up component derived types from contained procedures or,
still worse, interfaces.  The patch below fixes this by copying derived type
declarations in the same namespace first, followed by other namespaces
afterwards.  I am not entirely convinced that this is the whole story.  It
fixes the problem and regtests fine but. just give me 24 hours to dwell on
it:)

If you are in a position to check that this fixes 31551, I would be grateful
that you try.

Paul

Index: gcc/fortran/trans-types.c
===
*** gcc/fortran/trans-types.c   (révision 123693)
--- gcc/fortran/trans-types.c   (copie de travail)
*** gfc_get_derived_type (gfc_symbol * deriv
*** 1563,1569 

  /* Add this backend_decl to all the other, equal derived types.  */
  for (dt = gfc_derived_types; dt; dt = dt->next)
!   copy_dt_decls_ifequal (derived, dt->derived);

return derived->backend_decl;
  }
--- 1563,1574 

  /* Add this backend_decl to all the other, equal derived types.  */
  for (dt = gfc_derived_types; dt; dt = dt->next)
!   if (derived->ns == dt->derived->ns)
!   copy_dt_decls_ifequal (derived, dt->derived);
!
! for (dt = gfc_derived_types; dt; dt = dt->next)
!   if (derived->ns != dt->derived->ns)
!   copy_dt_decls_ifequal (derived, dt->derived);

return derived->backend_decl;
  }


-- 

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
   Last reconfirmed|2007-04-12 18:52:04 |2007-04-13 13:32:31
   date||


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



[Bug fortran/31550] [regression] f951: segfault in fold-const.c:1963

2007-04-12 Thread pault at gcc dot gnu dot org


--- Comment #4 from pault at gcc dot gnu dot org  2007-04-13 05:11 ---
(In reply to comment #3)

> Is this a problem with the backend?

Dream on, Mr Thomas! It's my own patch:

2007-03-18  Paul Thomas  <[EMAIL PROTECTED]>

PR fortran/30531
PR fortran/31086
* symbo.c : Add gfc_derived_types.
(gfc_free_dt_list): Free derived type list gfc_derived_types.
(gfc_free_namespace): Remove call to gfc_free_dt_list.
(gfc_symbol_done_2): Call  gfc_free_dt_list.
* gfortran.h : Declare gfc_derived_types to be external. Remove
derived types field from gfc_namespace.
* resolve.c (resolve_fl_derived): Refer to gfc_derived types
rather than namespace derived_types.
(resolve_fntype): Remove special treatment for module
derived type functions.
* trans-types.c (gfc_get_derived_type): Remove search for like
derived types.  Finish by copying back end declaration to like
derived types in the derived type list gfc_derived_types.

My bad feeling was warranted.

Paul


-- 


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



[Bug fortran/31550] [regression] f951: segfault in fold-const.c:1963

2007-04-12 Thread pault at gcc dot gnu dot org


--- Comment #3 from pault at gcc dot gnu dot org  2007-04-12 19:37 ---
What is really odd is that the same code (see below) is produced, with or
without the ONLY... It looks fine in either case and identical to that produced
by 4.2. *sigh*

Is this a problem with the backend?

Paul

dummy_atom_list_init_copy (this, other)
{
  int8 D.1373;
  int8 D.1372;
  struct dummy_atom[0:] * D.1371;
  int8 D.1370;
  int8 D.1369;
  struct dummy_atom[0:] * D.1368;

  D.1368 = (struct dummy_atom[0:] *) other->table.data;
  D.1369 = other->table.offset;
  D.1370 = (int8) other->nused;
  D.1371 = (struct dummy_atom[0:] *) this->table.data;
  D.1372 = this->table.offset;
  D.1373 = (int8) this->nused;
  {
int8 D.1376;
int8 D.1375;
int8 S.0;

D.1375 = other->table.dim[0].stride;
D.1376 = this->table.dim[0].stride;
S.0 = 1;
while (1)
  {
if (S.0 > (int8) other->nused) goto L.1;
(*D.1371)[S.0 * D.1376 + D.1372] = (*D.1368)[S.0 * D.1375 + D.1369];
S.0 = S.0 + 1;
  }
L.1:;
  }
}


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org


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



[Bug fortran/31550] [regression] f951: segfault in fold-const.c:1963

2007-04-12 Thread pault at gcc dot gnu dot org


--- Comment #2 from pault at gcc dot gnu dot org  2007-04-12 18:52 ---
(In reply to comment #1)
> Please note, that the USE-ONLY of "dummy_atom_list_merge" is crucial. Without
> it, the segfault does not occur.
> 
Confirmed - I have a bad feeling about this one!

Paul


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-04-12 18:52:04
   date||


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



[Bug fortran/31550] [regression] f951: segfault in fold-const.c:1963

2007-04-12 Thread dfranke at gcc dot gnu dot org


--- Comment #1 from dfranke at gcc dot gnu dot org  2007-04-12 17:08 ---
Please note, that the USE-ONLY of "dummy_atom_list_merge" is crucial. Without
it, the segfault does not occur.


-- 


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