This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix middle-end/35429 ICE with complex arithmetic and && or || with comparision to zero


On Wed, Mar 26, 2008 at 6:22 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> Hi,
>   The problem here is that fold uses integer_zerop to check if an
>  equal or no equal expression is the integer zero but integer_zerop
>  also returns true for complex integer zero.  Even before Richard's
>  patch to use build_int_cst, we were producing a BIT_IOR_EXPR of a
>  complex integer type which does not make sense.  This patch adds a
>  check for integeral types for these two optimizations.
>
>  OK? Bootstrapped and tested on i686-linux-gnu with no regressions.

This is ok.  (I never understood why we handle complex in integer_zerop...)

Thanks,
Richard.

>  Thanks,
>  Andrew Pinski
>
>  ChangeLog:
>
>  * fold-const.c (fold_truthop): Check for integeral types when folding
>  a == 0 && b == 0 and
>  a != 0 || b != 0 .
>
>  * gcc.c-torture/compile/complex-5.c: New test.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]