Summary: | Combine ~ and ^. | ||
---|---|---|---|
Product: | gcc | Reporter: | Kazu Hirata <kazu> |
Component: | tree-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | gabravier, gcc-bugs, pinskia |
Priority: | P2 | Keywords: | missed-optimization, TREE |
Version: | 4.0.0 | ||
Target Milestone: | 4.3.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2006-03-01 02:56:09 | |
Bug Depends on: | 15459 | ||
Bug Blocks: | 19986 |
Description
Kazu Hirata
2004-05-15 12:18:00 UTC
Confirmed. Will be fix by PR 15459 when fold is able to optimize ~(a<D1109>_1 ^ 65535) into ~a<D1104>_1 ^ 65535 I should note that the RTL level does this optimization. Actually it is better for ~(a ^ CST) to come out as a ^ ~CST. Right now we actually already implement ~(a^CST) as a ^ ~CST. So we need just to implement (~a) ^ CST as a ^ ~CST. In fact this is what simplify_rtx does. ~(a^CST) is done in fold_unary with the comment of: /* Convert ~(X ^ Y) to ~X ^ Y or X ^ ~Y if ~X or ~Y simplify. */ Only (~a^~b) is simplified. That can be expanded to: (~a^b) if ~b simplifies, simplify the expression. likewise for (a^~b) (if ~a simplifies, simplify the expression). I am going to implement this. I am no longer going to fix the fold issue, it is too much hasle to get this fixed. Subject: Bug 15458 Author: sayle Date: Sun Oct 29 17:51:07 2006 New Revision: 118152 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118152 Log: PR tree-optimization/15458 * fold-const.c (fold_binary): Optimize ~X ^ C as X ^ ~C, where C is a constant. * gcc.dg/fold-xornot-1.c: New test case. Added: trunk/gcc/testsuite/gcc.dg/fold-xornot-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/testsuite/ChangeLog Fixed. |