public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/50960] [OOP] vtables not marked as constant
Date: Thu, 03 Nov 2011 14:34:00 -0000	[thread overview]
Message-ID: <bug-50960-4-NliUyAXeXu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50960-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #17 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-03 14:34:02 UTC ---
(In reply to comment #16)
> (In reply to comment #11)
> > (In reply to comment #9)
> > > FAIL: gfortran.dg/extends_type_of_1.f03  -O0  (internal compiler error)
> > > FAIL: gfortran.dg/extends_type_of_3.f90  -O  (internal compiler error)
> > 
> > These two fail with:
> > 
> > internal compiler error: in fold_convert_loc, at fold-const.c:1894
> > 
> > Not quite sure what goes wrong there. Some typing problem?
> > 
> > 
> > Reduced test case:
> > 
> >  type :: t1
> >  end type
> > 
> >  type, extends(t1) :: t2
> >  end type
> > 
> >  class(t1), pointer :: c1
> >  type(t2) :: y
> > 
> >  if (.not. extends_type_of (y, c1)) call abort()
> > 
> > end
> 
> Looks like you are converting struct __vtype_MAIN___T1 to
> struct __vtype_MAIN___T1 *.  Thus probably too many TREE_TYPE ()
> wrappers somewhere or a forgotten address-taking.
> 
> Called from
> 
> 4608            {
> 4609              /* Scalar pointers.  */
> 4610              se.want_pointer = 1;
> 4611              gfc_conv_expr (&se, expr);
> 4612              gfc_add_block_to_block (&block, &se.pre);
> 4613              gfc_add_modify (&block, dest,
> 4614                                   fold_convert (TREE_TYPE (dest),
> se.expr))
> 
> where se.want_pointer (whatever it means) is not honored and se.expr
> is a variable of type struct __vtype_MAIN___T1.

Missing handling of se.want_pointer at least here:

void
gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
{
...
  if (!init)
    {
      /* Create a temporary variable and fill it in.  */
      se->expr = gfc_create_var (type, expr->ts.u.derived->name);
      tmp = gfc_trans_structure_assign (se->expr, expr);
      gfc_add_expr_to_block (&se->pre, tmp);
      return;

but what's the desire of the caller?  Is it to get &expr?  Something
seems to be seriously wrong.


  parent reply	other threads:[~2011-11-03 14:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02 10:43 [Bug fortran/50960] New: " burnus at gcc dot gnu.org
2011-11-02 11:58 ` [Bug fortran/50960] " janus at gcc dot gnu.org
2011-11-02 14:32 ` rguenth at gcc dot gnu.org
2011-11-02 14:38 ` rguenth at gcc dot gnu.org
2011-11-02 14:40 ` rguenth at gcc dot gnu.org
2011-11-02 14:58 ` burnus at gcc dot gnu.org
2011-11-02 15:08 ` janus at gcc dot gnu.org
2011-11-02 15:16 ` rguenth at gcc dot gnu.org
2011-11-02 16:45 ` janus at gcc dot gnu.org
2011-11-02 18:50 ` janus at gcc dot gnu.org
2011-11-02 20:11 ` janus at gcc dot gnu.org
2011-11-02 21:17 ` janus at gcc dot gnu.org
2011-11-03 12:07 ` janus at gcc dot gnu.org
2011-11-03 14:04 ` burnus at gcc dot gnu.org
2011-11-03 14:18 ` rguenth at gcc dot gnu.org
2011-11-03 14:24 ` burnus at gcc dot gnu.org
2011-11-03 14:30 ` rguenth at gcc dot gnu.org
2011-11-03 14:34 ` rguenth at gcc dot gnu.org [this message]
2011-11-03 22:33 ` burnus at gcc dot gnu.org
2011-11-07  7:36 ` burnus at gcc dot gnu.org
2011-11-07 22:59 ` janus at gcc dot gnu.org
2011-11-09  9:52 ` janus at gcc dot gnu.org
2011-11-09 16:07 ` janus at gcc dot gnu.org
2011-11-09 16:13 ` janus at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-50960-4-NliUyAXeXu@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).