[PATCH] Fix middle-end/30132: ICE with complex and taking the real part of a ?:

Andrew Pinski pinskia@gmail.com
Fri Nov 2 04:17:00 GMT 2007


On 3/20/07, Richard Henderson <rth@redhat.com> wrote:
> On Wed, Mar 14, 2007 at 02:58:28PM -0800, Andrew_Pinski@PlayStation.Sony.Com wrote:
> > +       /* If we don't already have an addressable expression, create a new
> > +          decl to hold it so we don't get non gimple as the decl which was
> > +          holding this before was not marked as addressable already.  */
> > +       if (TREE_CODE (op0) == VAR_DECL
> > +           && DECL_GIMPLE_FORMAL_TEMP_P (op0)
> > +           && !TREE_ADDRESSABLE (op0))
> > +         TREE_OPERAND (expr, 0) = get_initialized_tmp_var (op0, pre_p,
> > +                                                           post_p);
>
> How does this follow?  I can't think of any valid case for
> which we have a conditional store to a formal temporary.

I removed this part since it was not important to fix the testcase (I
will revisit this for another bug).

OK? Bootstrapped and tested on i686-apple-darwin.

Thanks,
Andrew Pinski


ChangeLog:

       * gimplifier.c (gimplify_cond_expr): Don't create *(a?&b:&c), if a
       rvalue is ok.

cp/ChangeLog:

       * typeck.c (build_address): For COND_EXPR, create a?&b:&c instead
       of the plain &(a?b:c) so we don't get a temp variable in the gimplifier.

testsuite/ChangeLog:

       * gcc.c-torture/compile/complex-5.c: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixpr30132.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20071102/e096957c/attachment.txt>


More information about the Gcc-patches mailing list