[PATCH, 4.5?] Fix get_ref_base_and_extent() handling of unions and variable sized arrays

Richard Guenther richard.guenther@gmail.com
Mon Dec 29 17:23:00 GMT 2008


On Tue, Dec 23, 2008 at 5:01 PM, Diego Novillo <dnovillo@google.com> wrote:
> On Fri, Dec 12, 2008 at 13:17, Martin Jambor <mjambor@suse.cz> wrote:
>
>> 2008-12-12  Martin Jambor  <mjambor@suse.cz>
>>
>>        * tree-dfa.c (get_ref_base_and_extent): Return -1 maxsize if
>>        seen_variable_array_ref while also traversing a union.
>
> OK for 4.5 with a testcase.

This is IMHO way too conservative and at least needs a /* FIXME */
note.  Only if
the union is trailing the array access will ever be trailing.  Only if
the array access
is trailing in the union member it will be trailing.  So, we should be
propagating
this 'trailing array access' upward the access chain, updating it if
there are following
(non-union) members instead.

Richard.

>
> Diego.
>



More information about the Gcc-patches mailing list