This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: gimplify vector constructors that aren't initialiser constants
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org, rsandifo at nildram dot co dot uk
- Date: Mon, 29 Oct 2007 22:56:18 +0100
- Subject: Re: RFA: gimplify vector constructors that aren't initialiser constants
- References: <877il5r3tq.fsf@firetop.home>
On 10/29/07, Richard Sandiford <rsandifo@nildram.co.uk> wrote:
> This is a second attempt at fixing PR 33614. We currently don't gimplify
> the contents of TREE_CONSTANT vector constructors, even if they need
> run-time evaluation.
>
> My first attempt at fixing this bug was based on the wrong assumption
> that we had two types of vector constructors: those that could be turned
> into VECTOR_CSTs and those that need run-time evaluation. Andrew pointed
> out that there's a third category: vector constructors that can't be
> reduced to a VECTOR_CST but that are legitimate initialiser constants
> (e.g. those involving ADDR_EXPRs). We want to continue to treat those
> constructors as TREE_CONSTANT.
>
> The patch below therefore adds an initializer_constant_valid_p check
> to the code that is trying to keep TREE_CONSTANT constructors. If this
> check fails, we turn the constructor into a nonconstant value and
> gimplify the contents.
>
> Bootstrapped & regression-tested on x86_64-linux-gnu. Also regression
> tested on mipsisa32-elf and mipsisa64-elf. It fixes an ICE in
> compile/20050113-1.c for mipsisa32-elf and an ICE the attached
> testcase for x86_64-linux-gnu. OK to install?
This is ok.
Thanks,
Richard.
> Richard
>
>
> gcc/
> PR tree-optimization/33614
> * gimplify.c (gimplify_init_constructor): Gimplify vector constructors
> if they can't be reduced to VECTOR_CSTs and aren't legitimate
> initializer constants.
>
> gcc/testsuite/
> PR tree-optimization/33614
> * gcc.c-torture/compile/pr33614.c: New test.