This is the mail archive of the
mailing list for the GCC project.
Re: Invalid gimple for nested functions
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 5 Aug 2014 10:54:43 +0200
- Subject: Re: Invalid gimple for nested functions
- Authentication-results: sourceware.org; auth=none
- References: <53DFEEF4 dot 3090305 at codesourcery dot com>
On Mon, Aug 4, 2014 at 10:37 PM, Bernd Schmidt <firstname.lastname@example.org> wrote:
> Some code I added for the ptx backend triggered tree-checking failures for
> gimple created in tree-nested: we can end up taking the address of an
> SSA_NAME, which seems invalid. The problem is that code in tree-nested wants
> to change the rhs of an existing assignment, but just using
> gimple_assign_set_rhs1 is insufficient: the previous rhs was an ADDR_EXPR,
> and that code remains afterwards.
> Fixed with the following patch, tested (including Ada) on x86_64-linux. Ok?
The better interface for this is gimple_assign_set_rhs_from_tree. But it
seems the code can be re-structured to avoid re-setting the RHS by
if (!is_gimple_reg (x)
&& is_gimple_reg_type (TREE_TYPE (x))
x = init_tmp_var (root, x, &gsi);
right after x is assigned to?
Ok with that change.