public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/44735] ICE on FORALL with character array pointer
Date: Thu, 01 Jul 2010 06:21:00 -0000	[thread overview]
Message-ID: <20100701062139.13788.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44735-14229@http.gcc.gnu.org/bugzilla/>



------- Comment #1 from burnus at gcc dot gnu dot org  2010-07-01 06:21 -------
Confirm.

Valgrind shows:

==11328== Invalid read of size 8
==11328==    at 0x6CBB86: fold_convert_loc (fold-const.c:1856)
==11328==    by 0x58E7A3: allocate_temp_for_forall_nest_1 (trans-stmt.c:2583)
==11328==    by 0x58F394: gfc_trans_assign_need_temp (trans-stmt.c:2702)
==11328==    by 0x59284C: gfc_trans_forall_1 (trans-stmt.c:3158)
==11328==    by 0x551DFF: trans_code (trans.c:1205)

Failing is the following line in fold-const.c
  tree orig = TREE_TYPE (arg);
which is the second argument in the following line of
allocate_temp_for_forall_nest_1:
   unit = fold_convert (gfc_array_index_type, TYPE_SIZE_UNIT (type));

It is set in gfc_trans_assign_need_temp:

  if (expr1->ts.type == BT_CHARACTER && expr1->ts.u.cl->length)
    ...
  else
    type = gfc_typenode_for_spec (&expr1->ts);

For the example, expr1->ts.type == BT_CHARACTER but expr1->ts.u.cl->length ==
NULL.

The symbol itself has:
(gdb) p *expr1->symtree->n.sym->ts.u.cl->length->value.integer._mp_d
$8 = 10

And the size is given by the expression:
(gdb) p expr1->ref->u.ss.start->expr_type 
$19 = EXPR_VARIABLE


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.3.4 4.4.0 4.5.1 4.6.0
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-01 06:21:38
               date|                            |


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


  reply	other threads:[~2010-07-01  6:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-30 21:34 [Bug fortran/44735] New: " jkrahn at nc dot rr dot com
2010-07-01  6:21 ` burnus at gcc dot gnu dot org [this message]
2010-08-18 18:55 ` [Bug fortran/44735] " pault at gcc dot gnu dot org
     [not found] <bug-44735-4@http.gcc.gnu.org/bugzilla/>
2010-12-29 22:18 ` tkoenig at gcc dot gnu.org
2013-03-17 15:25 ` tkoenig at gcc dot gnu.org
2014-08-29  9:44 ` dominiq at lps dot ens.fr
2014-08-31 14:37 ` tkoenig at gcc dot gnu.org
2015-05-04 14:27 ` fxcoudert at gcc dot gnu.org
2015-05-04 14:31 ` fxcoudert 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=20100701062139.13788.qmail@sourceware.org \
    --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).