This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/52265] [OOP] TREE dump confusing with nested SELECT TYPE


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

--- Comment #1 from paul.richard.thomas at gmail dot com <paul.richard.thomas at gmail dot com> 2012-02-16 06:58:10 UTC ---
Dear Tobias,

I have encountered this in the work on PR41600.  I thought to append a
numeric identifier that increments with each new temporary.  In fact,
I had wondered whether, once the SELECT TYPE is working properly, we
should not simplify the name to __tmp.###?  The present complexity
serves no purpose, since we can tell from the type what tehse things
are.

Cheers

Paul

PS PR41600 is fixed, barring some cleaning up.  Correct code is being
produced but the compiler segfaults at the due to attempted double
frees of array_specs.  I am pretty sure that I know where this is
happening - I'll let you know at lunchtime.

On Wed, Feb 15, 2012 at 9:51 PM, burnus at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52265
>
> Â Â Â Â Â Â Bug #: 52265
> Â Â Â Â Â Summary: [OOP] TREE dump confusing with nested SELECT TYPE
> Â ÂClassification: Unclassified
> Â Â Â Â Â Product: gcc
> Â Â Â Â Â Version: 4.7.0
> Â Â Â Â Â ÂStatus: UNCONFIRMED
> Â Â Â Â ÂKeywords: diagnostic
> Â Â Â Â ÂSeverity: normal
> Â Â Â Â ÂPriority: P3
> Â Â Â Â Component: fortran
> Â Â Â ÂAssignedTo: unassigned@gcc.gnu.org
> Â Â Â ÂReportedBy: burnus@gcc.gnu.org
> Â Â Â Â Â Â Â ÂCC: pault@gcc.gnu.org
>
>
> The following program seems to work as expected, however, the dump is very
> irritating:
>
> Â Â Â Âswitch (a._vptr->_hash)
> Â Â Â Â Â{
> Â Â Â Â Â Âcase 6231989:;
> Â Â Â Â Â Â__tmp_type_t = a._data;
> Â Â Â Â Â Â{
> Â Â Â Â Â Â Âstruct t * __tmp_type_t;
>
> Â Â Â Â Â Â Âswitch (b._vptr->_hash)
> Â Â Â Â Â Â Â Â{
> Â Â Â Â Â Â Â Â Âcase 6231989:;
> Â Â Â Â Â Â Â Â Â__tmp_type_t = b._data;
> Â Â Â Â Â Â Â Â Â*__tmp_type_t = *__tmp_type_t;
>
> There are two variables called "__tmp_type_t", one pointing to a._data and the
> other to b._data. Most striking is the last line where both variables occur.
> That's very confusing and would be impossible to do in C, C++, or Fortran.
>
> Expected: Use different variable names, e.g. via
> Âgfc_create_var (type, "__tmp_type_t")
>
>
> type t
> Âinteger :: i = 5
> end type t
>
> class(t), allocatable :: a, b
>
> allocate(a,b)
> b%i = 77
> select type (a)
> Âtype is (t)
> Â select type (b)
> Â Â type is (t)
> Â Â Â a = b
> Â Â Â b%i = 88
> Â end select
> end select
> if (a%i /= 77) call abort ()
> if (a%i /= 88) call abort ()
> end
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]