https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86046

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2018-06-05
   Target Milestone|---                         |9.0
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  After CCP:

No longer having address taken: D.1960

but then we fail to rewrite it.

  VIEW_CONVERT_EXPR<int[1]>(D.1960)[1] = 0;

Ah, so the issue seems to be that D.1960 is already DECL_GIMPLE_REG_P but
it is just TREE_ADDRESSABLE avoiding the rewriting need.  But
update_address_taken simply clears TREE_ADDRESSABLE but leaves
DECL_GIMPLE_REG_P
in place thinking it cannot be set.

The issue may be premature setting of DECL_GIMPLE_REG_P but we can work around
this in update_address_taken.

There's a missed optimization as well, we expect to rewrite the array-ref into
a bitfield ref during gimplification.  Ah, but we avoid doing that for
the out-of-bound access this is.

Reply via email to