On Fri, 9 Oct 2015, Jan Hubicka wrote:

> > 
> > Index: expr.c
> > ===================================================================
> > --- expr.c  (revision 228604)
> > +++ expr.c  (working copy)
> > @@ -6703,7 +6704,7 @@ store_field (rtx target, HOST_WIDE_INT b
> >       emit_group_store (temp_target, temp, TREE_TYPE (exp), size);
> >       temp = temp_target;
> >     }
> > -      else if (mode == BLKmode)
> > +      else if (GET_MODE (temp) == BLKmode)
> >     {
> >       /* Handle calls that return BLKmode values in registers.  */
> >       if (REG_P (temp) && TREE_CODE (exp) == CALL_EXPR)
> 
> This patch passed the testing, so if FIELD_DECL of VOIDmode referring BLKmode
> type is a sane thing, I guess this is a right fix.  I would say that however
> the type of FIELD_DECL should be compatible with the type of COMPONENT_REF and
> that should be added to the Gimple operand testing and fixed at Ada side?

I think a FIELD_DECL with VOIDmode is odd.  And yes, the type of
the COMPONENT_REF should be that of the FIELD_DECL (or a variant type
of it as we share FIELD_DECLs for record variants).  We do verify this
however:

static bool
verify_types_in_gimple_reference (tree expr, bool require_lvalue)
{
...
      if (TREE_CODE (expr) == COMPONENT_REF
          && !useless_type_conversion_p (TREE_TYPE (expr),
                                         TREE_TYPE (TREE_OPERAND (expr, 
1))))
        {
          error ("type mismatch in component reference");
          debug_generic_stmt (TREE_TYPE (expr));
          debug_generic_stmt (TREE_TYPE (TREE_OPERAND (expr, 1)));
          return true;
        }

though if the type is an aggregate useless_type_conversion_p doesn't do
much now.

Richard.

> Honza
> 
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 
21284 (AG Nuernberg)

Reply via email to