[PATCH] use TYPE_SIZE instead of TYPE_DOMAIN to compute array size (PR 86400)

Richard Biener richard.guenther@gmail.com
Thu Jul 5 08:07:00 GMT 2018


On Thu, Jul 5, 2018 at 4:17 AM Martin Sebor <msebor@gmail.com> wrote:
>
> A change of mine to the strlen pass assumes that the strlen
> argument points to an object of the correct type and does
> not correctly handle GIMPLE where the argument has the wrong
> type such as in:
>
>    extern char a[1][2];
>    n = strlen (*a);
>
> where the strlen pass actually sees
>
>    n = strlen (a);
>
> The attached patch corrects the code to use TYPE_SIZE to
> determine the size of the array argument rather than using
> TYPE_DOMAIN.
>
> Tested on x86_64-linux.

OK.

Richard.

> Martin
>



More information about the Gcc-patches mailing list