public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/54990] New: [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE
@ 2012-10-19 17:08 janus at gcc dot gnu.org
  2012-10-22  9:09 ` [Bug fortran/54990] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: janus at gcc dot gnu.org @ 2012-10-19 17:08 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54990
           Summary: [4.8 Regression] [OOP] ICE in tree_operand_check on
                    SELECT TYPE
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: janus@gcc.gnu.org
                CC: abensonca@gmail.com


Reported by Andrew Benson at
http://gcc.gnu.org/ml/fortran/2012-10/msg00094.html. Reduced test case:


program test
  implicit none

  type :: ncBhStd
  end type

  type :: tn
    class (ncBhStd), allocatable, dimension(:) :: cBh
  end type

  type(tn), target :: a

  select type (q => a%cBh(1))
  end select

end


Compiles cleanly with 4.7, but trunk gives the following ICE:


internal compiler error: tree check: expected class ‘expression’, have
‘declaration’ (var_decl) in tree_operand_check, at tree.h:4109
 program test
 ^
linux-vdso.so.1: No such file or directory
0xcf07be tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /home/jweil/gcc48/trunk/gcc/tree.c:8947
0x62d6a8 expr_check
        /home/jweil/gcc48/trunk/gcc/tree.h:3845
0x62d6a8 tree_operand_check
        /home/jweil/gcc48/trunk/gcc/tree.h:4109
0x62d6a8 gfc_get_vptr_from_expr(tree_node*)
        /home/jweil/gcc48/trunk/gcc/fortran/trans-expr.c:199
0x667411 trans_associate_var
        /home/jweil/gcc48/trunk/gcc/fortran/trans-stmt.c:1256
0x66771c gfc_trans_block_construct(gfc_code*)
        /home/jweil/gcc48/trunk/gcc/fortran/trans-stmt.c:1319
0x5fb900 trans_code
        /home/jweil/gcc48/trunk/gcc/fortran/trans.c:1412
0x5fbc62 gfc_trans_code(gfc_code*)
        /home/jweil/gcc48/trunk/gcc/fortran/trans.c:1573
0x62add7 gfc_generate_function_code(gfc_namespace*)
        /home/jweil/gcc48/trunk/gcc/fortran/trans-decl.c:5353
0x5fbca6 gfc_generate_code(gfc_namespace*)
        /home/jweil/gcc48/trunk/gcc/fortran/trans.c:1590
0x59d211 translate_all_program_units
        /home/jweil/gcc48/trunk/gcc/fortran/parse.c:4467
0x59d877 gfc_parse_file()
        /home/jweil/gcc48/trunk/gcc/fortran/parse.c:4681
0x5e8900 gfc_be_parse_file
        /home/jweil/gcc48/trunk/gcc/fortran/f95-lang.c:191


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

* [Bug fortran/54990] [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE
  2012-10-19 17:08 [Bug fortran/54990] New: [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE janus at gcc dot gnu.org
@ 2012-10-22  9:09 ` rguenth at gcc dot gnu.org
  2012-11-07 13:15 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-22  9:09 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


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

* [Bug fortran/54990] [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE
  2012-10-19 17:08 [Bug fortran/54990] New: [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE janus at gcc dot gnu.org
  2012-10-22  9:09 ` [Bug fortran/54990] " rguenth at gcc dot gnu.org
@ 2012-11-07 13:15 ` jakub at gcc dot gnu.org
  2012-12-16 15:27 ` pault at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-07 13:15 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
                 CC|                            |jakub at gcc dot gnu.org


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

* [Bug fortran/54990] [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE
  2012-10-19 17:08 [Bug fortran/54990] New: [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE janus at gcc dot gnu.org
  2012-10-22  9:09 ` [Bug fortran/54990] " rguenth at gcc dot gnu.org
  2012-11-07 13:15 ` jakub at gcc dot gnu.org
@ 2012-12-16 15:27 ` pault at gcc dot gnu.org
  2013-01-07  9:06 ` pault at gcc dot gnu.org
  2013-01-07 19:11 ` pault at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu.org @ 2012-12-16 15:27 UTC (permalink / raw)
  To: gcc-bugs


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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-12-16
                 CC|                            |pault at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |pault at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Paul Thomas <pault at gcc dot gnu.org> 2012-12-16 15:27:24 UTC ---
trans-expr.c:203

tree
gfc_get_vptr_from_expr (tree expr)
{
  tree tmp = expr;
  while (tmp && !GFC_CLASS_TYPE_P (TREE_TYPE (tmp)))
    tmp = TREE_OPERAND (tmp, 0);
  tmp = gfc_class_vptr_get (tmp);
  return tmp;
}

is changed to

tree
gfc_get_vptr_from_expr (tree expr)
{
  tree tmp = expr;
  while (tmp && !GFC_CLASS_TYPE_P (TREE_TYPE (tmp))
     && !(TYPE_CANONICAL (TREE_TYPE (tmp))
          && GFC_CLASS_TYPE_P (TYPE_CANONICAL (TREE_TYPE (tmp)))))
    tmp = TREE_OPERAND (tmp, 0);
  tmp = gfc_class_vptr_get (tmp);
  return tmp;
}

the bug is fixed.  The array reference seems to spin a new TREE_TYPE for the
class container that does not get marked as GFC_CLASS_TYPE_P.  I have no idea
why or what might have changed it.

As soon as I get the unlimited polymorphic patch committed, I will submit this
as a patch with the testcase:

program test
  implicit none
  type :: ncBhStd
    integer :: i
  end type
  type :: tn
    class (ncBhStd), allocatable, dimension(:) :: cBh
  end type
  integer :: i
  type(tn), target :: a
  allocate (a%cBh(2), source = [(ncBhStd(i*99), i = 1,2)])
  select type (q => a%cBh(1))
    type is (ncBhStd)
      if (q%i .ne. 99) call abort
  end select

end


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

* [Bug fortran/54990] [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE
  2012-10-19 17:08 [Bug fortran/54990] New: [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE janus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-12-16 15:27 ` pault at gcc dot gnu.org
@ 2013-01-07  9:06 ` pault at gcc dot gnu.org
  2013-01-07 19:11 ` pault at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu.org @ 2013-01-07  9:06 UTC (permalink / raw)
  To: gcc-bugs


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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> 2013-01-07 09:06:26 UTC ---
Fixed by http://gcc.gnu.org/viewcvs?view=revision&revision=194953

It did not register here because I screwed up on the ChangeLog Format (I really
am rusty  :-) ).  I'll fix this tonight.

Thanks for the report.

Paul


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

* [Bug fortran/54990] [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE
  2012-10-19 17:08 [Bug fortran/54990] New: [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE janus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-01-07  9:06 ` pault at gcc dot gnu.org
@ 2013-01-07 19:11 ` pault at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu.org @ 2013-01-07 19:11 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> 2013-01-07 19:10:41 UTC ---
Author: pault
Date: Mon Jan  7 19:10:32 2013
New Revision: 194994

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194994
Log:
2013-01-07  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/53876
    PR fortran/54990
    PR fortran/54992
    * ChangeLog: Correct format error in revision 194953

2013-01-07  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/53876
    PR fortran/54990
    PR fortran/54992
    * ChangeLog: Correct format error in revision 194953

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2013-01-07 19:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-19 17:08 [Bug fortran/54990] New: [4.8 Regression] [OOP] ICE in tree_operand_check on SELECT TYPE janus at gcc dot gnu.org
2012-10-22  9:09 ` [Bug fortran/54990] " rguenth at gcc dot gnu.org
2012-11-07 13:15 ` jakub at gcc dot gnu.org
2012-12-16 15:27 ` pault at gcc dot gnu.org
2013-01-07  9:06 ` pault at gcc dot gnu.org
2013-01-07 19:11 ` pault at gcc dot gnu.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).