This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ACATS cc50a01 at -O
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Eric Botcazou" <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 20 Apr 2008 19:33:45 +0200
- Subject: Re: [PATCH] Fix ACATS cc50a01 at -O
- References: <200804201342.09021.ebotcazou@adacore.com>
On Sun, Apr 20, 2008 at 1:42 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> This is a bad interaction between VIEW_CONVERT_EXPR and the tree SRA pass.
> When sra_walk_expr runs into a VIEW_CONVERT_EXPR or NOP_EXPR, it deems the
> expression an access to the whole object:
>
> case VIEW_CONVERT_EXPR:
> case NOP_EXPR:
> /* Similarly, a view/nop explicitly wants to look at an object in a
> type other than the one we've scalarized. */
> goto use_all;
>
> There is a problem when VIEW_CONVERT_EXPR is on the LHS because an access to
> the whole object means a killing def and this is not necessarily true:
>
> D.1939 ={v} VIEW_CONVERT_EXPR<struct fc50a00__count_type>(*D.1935_7);
> R63b ={v} {};
> R63b.F ={v} D.1939;
> [...]
> VIEW_CONVERT_EXPR<struct fc50a00__count_type>(R63b.F)._tag ={v} D.1941_9;
>
> is obviously not a killing def for R63b.F, yet it is scalarized as if it was:
>
> SR.32_16 = VIEW_CONVERT_EXPR<struct fc50a00__count_type>(*D.1935_7).count;
> SR.31_17 = VIEW_CONVERT_EXPR<struct fc50a00__count_type>(*D.1935_7)._tag;
> [...]
> SR.30_20 = SR.32_16;
> SR.29_21 = SR.31_17;
> [...]
> VIEW_CONVERT_EXPR<struct fc50a00__count_type>(R63b.F)._tag ={v} D.1941_9;
> SR.30_22 = R63b.F.count;
> SR.29_23 = R63b.F._tag;
> [...]
> R63b.F.count ={v} SR.30_22;
> R63b.F._tag ={v} SR.29_23;
>
> R63b.F.count is left uninitialized.
>
> Tested on i586-suse-linux, OK for mainline?
Ok.
Thanks,
Richard.
> 2008-04-20 Eric Botcazou <ebotcazou@adacore.com>
>
> * tree-sra.c (sra_walk_expr) <VIEW_CONVERT_EXPR>: Disable
> scalarization if on the LHS and not a full access.
>
>
> --
> Eric Botcazou
>