public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/44988] [4.6 Regression] ICE: in make_decl_rtl, at varasm.c:1346 at -O1
Date: Mon, 19 Jul 2010 14:43:00 -0000	[thread overview]
Message-ID: <20100719144324.12601.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44988-14164@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-07-19 14:43 -------
Ick.  The problem is that with MEM_REF we now have local variables that
are is_gimple_reg () but not in SSA form.

void
foo (void)
{
  int i = 0;
  bar (*(struct S *) &i);
}

is undefined and thus we remove the initializer and expand from

foo ()
{
  int i;

  # BLOCK 2 freq:10000
  # PRED: ENTRY [100.0%]  (fallthru,exec)
  bar (MEM[(struct S *)&i]);
  return;
  # SUCC: EXIT [100.0%]

}

where when processing the remaining local decls we stop processing 'i' at

      /* Expanded above already.  */
      if (is_gimple_reg (var))
        {
          TREE_USED (var) = 0;
          goto next;
        }

the issue is probably latent on the 4.5 branch if we manage to end up with

   bar (VIEW_CONVERT <struct S>(i));

instead.

We could rewrite i into SSA form but would have troubles with even more
undefined code which would require a VIEW_CONVERT_EXPR to a different
sized object (which we now reject during gimple validation - the
view-converted use is the reason we don't rewrite it in the first place).

Another long-standing idea was to extend the use of DECL_GIMPLE_REG_P
to all variables (including those that are always registers).  That
enables a check for whether a variable is in SSA form.

OTOH update-address-taken is to properly honor this and it does, it
is just missing handling of call arguments.  I have a patch.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
          Component|rtl-optimization            |tree-optimization
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-19 14:43:24
               date|                            |
   Target Milestone|---                         |4.6.0


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


  parent reply	other threads:[~2010-07-19 14:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19 13:32 [Bug rtl-optimization/44988] New: " zsojka at seznam dot cz
2010-07-19 13:33 ` [Bug rtl-optimization/44988] " zsojka at seznam dot cz
2010-07-19 14:43 ` rguenth at gcc dot gnu dot org [this message]
2010-07-20 11:29 ` [Bug tree-optimization/44988] " rguenth at gcc dot gnu dot org
2010-07-20 11:29 ` 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=20100719144324.12601.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).