On Wed, 6 Nov 2013, Richard Sandiford wrote:
> Richard Biener writes:
> > --- 599,615
> >
> > exp = TREE_OPERAND (exp, 0);
> > }
> >
> > + /* We need to deal with variable arrays ending structures. */
> > + if (seen_variable_array_ref
> > + && maxsize != -1
> >
Richard Biener writes:
> --- 599,615
>
> exp = TREE_OPERAND (exp, 0);
> }
>
> + /* We need to deal with variable arrays ending structures. */
> + if (seen_variable_array_ref
> + && maxsize != -1
> + && (!bit_offset.fits_shwi ()
> + || !host_integerp
The following fixes PR58941 - we fail to detect a trailing array
access in get_ref_base_and_extent because, while we remember
the type to check, we still apply an extra offset that confuses us.
Fixed by handling trailing arrays at places we view-convert.
Bootstrapped and tested on x86_64-unknown-