public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amacleod at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/23297] immediate uses hosed after CCP
Date: Wed, 10 Aug 2005 15:56:00 -0000	[thread overview]
Message-ID: <20050810155600.24645.qmail@sourceware.org> (raw)
In-Reply-To: <20050809154854.23297.rguenth@gcc.gnu.org>


------- Additional Comments From amacleod at redhat dot com  2005-08-10 15:55 -------
A quick glance shows that parse_ssa_operands() does not expect to receive a tree
that looks like:

b.c[d_5].i

get_expr_operands is called on this, and  when processing COMPONENT_REF:
       ref = okay_component_ref_for_subvars (expr, &offset, &size);
        if (ref)
          {
            subvar_t svars = get_subvars_for_var (ref);
            subvar_t sv;
            for (sv = svars; sv; sv = sv->next)
              {
                bool exact;
                if (overlap_subvar (offset, size, sv, &exact))
                  {
                    int subvar_flags = flags;
                    if (!exact)
                      subvar_flags &= ~opf_kill_def;
                    add_stmt_operand (&sv->var, s_ann, subvar_flags);
                  }
              }
          }
        else
          get_expr_operands (stmt, &TREE_OPERAND (expr, 0),
                             flags & ~opf_kill_def);

if okay_component_ref_for_subvars() is true (which it is in this case), we never
call get_expr_operands on the rest of the expression, which contains the array
ref. Therefore the operand builder never sees the use of d_5 in the expression,
and chaos breaks out as you have observed.

I dont pay much attention to the semantics of gimple, but either b.c[d_5].i is
not valid gimple, or you have to be prepared to explore the component ref deeper
in get_expr_operands.  I would have expected to trip over this earlier if it was
valid, but what do I know :-)

 

-- 


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


  parent reply	other threads:[~2005-08-10 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-09 15:48 [Bug tree-optimization/23297] New: " rguenth at gcc dot gnu dot org
2005-08-09 15:49 ` [Bug tree-optimization/23297] " rguenth at gcc dot gnu dot org
2005-08-09 15:52 ` rguenth at gcc dot gnu dot org
2005-08-10 15:56 ` amacleod at redhat dot com [this message]
2005-08-11  8:31 ` rguenth at gcc dot gnu dot org
2005-08-11  8:32 ` rguenth at gcc dot gnu dot org
     [not found] <bug-23297-10053@http.gcc.gnu.org/bugzilla/>
2005-10-16 10:41 ` rguenth at gcc dot gnu dot 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=20050810155600.24645.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).