[PATCH] [C and C++ front-ends] Fix PR C/C++ 31339: ICE on invalid use of complex constant

Andrew_Pinski@PlayStation.Sony.Com Andrew_Pinski@PlayStation.Sony.Com
Fri May 25 01:33:00 GMT 2007


Hi,
  The problem here is that we produce a COMPLEX_EXPR with an error mark 
node.  We could handle error mark node better in the middle-end but that 
would slow down the common case and also slow down the compilier even more 
as we call fold a lot now with tree-ssa.  Instead this patch makes us 
never generate a COMPLEX_EXPR with an error mark node in the front-ends.

OK? Bootstrapped and tested on i686-linux-gnu with no regressions.

Thanks,
Andrew Pinski

ChangeLog:

        * c-typeck.c (build_unary_op <case PREINCREMENT_EXPR,
        case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
        case POSTDECREMENT_EXPR>): Return the error_mark_node
        if either the real or imaginary parts would an
        error_mark_node.

cp/ChangeLog:

        * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
        case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
        case POSTDECREMENT_EXPR>): Return the error_mark_node
        if either the real or imaginary parts would an
        error_mark_node.

testsuite/ChangeLog:

        * gcc.dg/boolcomplex-1.c: New test.
        * g++.dg/ext/boolcomplex-1.c: New test.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixpr31339.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070525/a8759dab/attachment.txt>


More information about the Gcc-patches mailing list