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]

[PATCH] Handle REALPART_EXPR and IMAGPART_EXPR for Store_CCP


I noticed that store CCP was not handling REALPART_EXPR when the full expression was
initialized as a constant.
So we have t = __complex__ (0.0, 0.0);
USE (__real__ t);


But we did not propagate 0.0 into the use as we would not recognized that for
REALPART_EXPR <t> would use only part of t. So I added the checking for
REALPART_EXPR and IMAGPART_EXPR specially to ccp_fold for the store_ccp case.


OK? Bootstrap and tested on powerpc-darwin and x86_64-linux.

Thanks,
Andrew Pinski


ChangeLog: * tree-ssa-ccp.c (ccp_fold): Handle store CCP of REALPART_EXPR and IMAGPART_EXPR.

* testsuite/gcc.dg/tree-ssa/complex-3.c: New test.

Attachment: fixrealpart.diff.txt
Description: Text document


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