This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR 29984, PPC-SPE segfaults with MAX_EXPR <a, a>
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: iant at google dot com (Ian Lance Taylor)
- Cc: pinskia at gmail dot com (Andrew Pinski), gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Nov 2006 17:06:18 -0500 (EST)
- Subject: Re: [PATCH] Fix PR 29984, PPC-SPE segfaults with MAX_EXPR <a, a>
>
> Andrew Pinski <pinskia@gmail.com> writes:
>
> > * tree-ssa-reassoc.c (eliminate_duplicate_pair): Handle MAX_EXPR
> > and MIN_EXRP.
> >
> > * gcc.dg/tree-ssa/reassoc-12.c: New test.
>
> This is OK.
>
> Thanks.
>
> > The reason why it ICEs is because the backend is not ready ready
> > to handle MAX_EXPR <a, a> which was created by the reassociation pass in
> > the first place.
>
> And, in case you haven't already done it, it seems to me that you have
> to fix that anyhow, for -O0.
I cannot figure out a way to produce MAX_EXPR<a,a> at -O0. Fold does not produce it
for "a>a?a:a" as it just produces a and fold has code to optimize MAX_EXPR and MIN_EXPR with
the same operand down to that operand:
case MIN_EXPR:
if (operand_equal_p (arg0, arg1, 0))
return omit_one_operand (type, arg0, arg1);
....
case MAX_EXPR:
if (operand_equal_p (arg0, arg1, 0))
return omit_one_operand (type, arg0, arg1);
Thanks,
Andrew Pinski