public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31163]  New: SAVEd derived types with ALLOCATABLE components don't work
@ 2007-03-13 14:24 sfilippone at uniroma2 dot it
  2007-03-13 14:25 ` [Bug fortran/31163] " sfilippone at uniroma2 dot it
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: sfilippone at uniroma2 dot it @ 2007-03-13 14:24 UTC (permalink / raw)
  To: gcc-bugs

The output from the attached code looks wrong, as if the derived type
components are not SAVEd. 
-----------------output---------------------
[sfilippo@localhost bugtest]$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.3-20070302/configure --prefix=/usr/local/gcc43
--with-mpfr=/home/travel/GCC/BUILDS/mpfr
--with-gmp-lib=/home/travel/GCC/BUILDS/gmp/lib/
--with-gmp=/home/travel/GCC/BUILDS/gmp
Thread model: posix
gcc version 4.3.0 20070302 (experimental)
[sfilippo@localhost bugtest]$ ./savebug 
 After first call            0
 After second call            0

----------------- output with Intel fortran ---------
[sfilippo@localhost bugtest]$ ifort -o savebug savebug.f90 
[sfilippo@localhost bugtest]$ ./savebug 
 After first call            0
 After second call           10


-- 
           Summary: SAVEd derived types with ALLOCATABLE components don't
                    work
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sfilippone at uniroma2 dot it
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/31163] SAVEd derived types with ALLOCATABLE components don't work
  2007-03-13 14:24 [Bug fortran/31163] New: SAVEd derived types with ALLOCATABLE components don't work sfilippone at uniroma2 dot it
@ 2007-03-13 14:25 ` sfilippone at uniroma2 dot it
  2007-03-13 14:33 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: sfilippone at uniroma2 dot it @ 2007-03-13 14:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from sfilippone at uniroma2 dot it  2007-03-13 14:25 -------
Created an attachment (id=13200)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13200&action=view)
test case


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/31163] SAVEd derived types with ALLOCATABLE components don't work
  2007-03-13 14:24 [Bug fortran/31163] New: SAVEd derived types with ALLOCATABLE components don't work sfilippone at uniroma2 dot it
  2007-03-13 14:25 ` [Bug fortran/31163] " sfilippone at uniroma2 dot it
@ 2007-03-13 14:33 ` burnus at gcc dot gnu dot org
  2007-03-14  6:35 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-03-13 14:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2007-03-13 14:33 -------
Andrew wrote:
--------------------------------------------------
it is obvious from the tree dump, what is going on:
 static struct foo_type f_a = {};

 f_a.mv.data = 0B;

So save is done correctly but allocatables in the derived type is not.
Even at the end of the function:
{
   int4 D.965;

   _gfortran_deallocate (f_a.mv.data, &D.965);
   f_a.mv.data = 0B;
 }

So it deallocates it.
-------------------------

And I wrote:
-------------------------
It seems to be related to allocatable
components as  if I change them to pointers (incl. =>NULL initialization
and allocated -> associated), it works.

Pointer:
  static struct foo_type f_a = {.mv={.data=0B}};

Allocatable:
  static struct foo_type f_a = {};
  f_a.mv.data = 0B;

That is: The 0B initialization happens always.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-13 14:33:24
               date|                            |


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/31163] SAVEd derived types with ALLOCATABLE components don't work
  2007-03-13 14:24 [Bug fortran/31163] New: SAVEd derived types with ALLOCATABLE components don't work sfilippone at uniroma2 dot it
  2007-03-13 14:25 ` [Bug fortran/31163] " sfilippone at uniroma2 dot it
  2007-03-13 14:33 ` burnus at gcc dot gnu dot org
@ 2007-03-14  6:35 ` patchapp at dberlin dot org
  2007-03-15  6:45 ` pault at gcc dot gnu dot org
  2007-03-27  9:05 ` [Bug fortran/31163] [4.2 only] " pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: patchapp at dberlin dot org @ 2007-03-14  6:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from patchapp at dberlin dot org  2007-03-14 06:35 -------
Subject: Bug number PR31163

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-03/msg00898.html


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/31163] SAVEd derived types with ALLOCATABLE components don't work
  2007-03-13 14:24 [Bug fortran/31163] New: SAVEd derived types with ALLOCATABLE components don't work sfilippone at uniroma2 dot it
                   ` (2 preceding siblings ...)
  2007-03-14  6:35 ` patchapp at dberlin dot org
@ 2007-03-15  6:45 ` pault at gcc dot gnu dot org
  2007-03-27  9:05 ` [Bug fortran/31163] [4.2 only] " pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-03-15  6:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2007-03-15 06:44 -------
Subject: Bug 31163

Author: pault
Date: Thu Mar 15 06:44:25 2007
New Revision: 122944

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122944
Log:
2007-03-15  Tobias Burnus  <burnus@gcc.gnu.org>
            Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30922
        * decl.c (gfc_match_import): If the parent of the current name-
        space is null, try looking for an imported symbol in the parent
        of the proc_name interface.
        * resolve.c (resolve_fl_variable): Do not check for blocking of
        host association by a same symbol, if the symbol is in an
        interface body.

2007-03-15  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30879
        * decl.c (match_data_constant): Before going on to try to match
        a name, try to match a structure component.


        PR fortran/30870
        * resolve.c (resolve_actual_arglist): Do not reject a generic
        actual argument if it has a same name specific interface.

        PR fortran/31163
        * trans-array.c (parse_interface): Do not nullify allocatable
        components if the symbol has the saved attribute.


2007-03-15  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30922
        * gfortran.dg/import5.f90.f90: New test.


        PR fortran/30879
        * gfortran.dg/data_components_1.f90: New test.


        PR fortran/30870
        * gfortran.dg/generic_13.f90: New test.

        PR fortran/31163
        * gfortran.dg/alloc_comp_basics_5.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/alloc_comp_basics_5.f90
    trunk/gcc/testsuite/gfortran.dg/data_components_1.f90
    trunk/gcc/testsuite/gfortran.dg/generic_13.f90
    trunk/gcc/testsuite/gfortran.dg/import5.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/31163] [4.2 only] SAVEd derived types with ALLOCATABLE components don't work
  2007-03-13 14:24 [Bug fortran/31163] New: SAVEd derived types with ALLOCATABLE components don't work sfilippone at uniroma2 dot it
                   ` (3 preceding siblings ...)
  2007-03-15  6:45 ` pault at gcc dot gnu dot org
@ 2007-03-27  9:05 ` pault at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-03-27  9:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2007-03-27 10:04 -------
This is not a regression wrt 4.1 so closing.

Paul


-- 

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-03-27  9:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-13 14:24 [Bug fortran/31163] New: SAVEd derived types with ALLOCATABLE components don't work sfilippone at uniroma2 dot it
2007-03-13 14:25 ` [Bug fortran/31163] " sfilippone at uniroma2 dot it
2007-03-13 14:33 ` burnus at gcc dot gnu dot org
2007-03-14  6:35 ` patchapp at dberlin dot org
2007-03-15  6:45 ` pault at gcc dot gnu dot org
2007-03-27  9:05 ` [Bug fortran/31163] [4.2 only] " 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).