------- Comment #2 from rguenth at gcc dot gnu dot org  2007-10-09 10:56 -------
This happens because we canonicalize the component ref (as we pretend an rvalue
is ok) via gimplify_addr_expr:

      /* We use fb_either here because the C frontend sometimes takes
         the address of a call that returns a struct; see
         gcc.dg/c99-array-lval-1.c.  The gimplifier will correctly make
         the implied temporary explicit.  */

      /* Mark the RHS addressable.  */
      ret = gimplify_expr (&TREE_OPERAND (expr, 0), pre_p, post_p,
                           is_gimple_addressable, fb_either);

and gimplify_compound_lval which canonicalizes the outermost component
reference.  Which is incorrect in this case, as it strips type qualifiers.


-- 


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

Reply via email to