[Bug tree-optimization/44988] [4.6 Regression] ICE: in make_decl_rtl, at varasm.c:1346 at -O1

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jul 19 14:43:00 GMT 2010



------- 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



More information about the Gcc-bugs mailing list