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 middle-end]: Missed optimization for (x & ~y) | (~x & y)


Hello,

well the bonus points might gain somebody else ... But this adds a
missing optimization
for tree level implemented in fold-const.

ChangeLog gcc/

2011-04-20  Kai Tietz

	* fold-const.c (fold_binary_loc): Add handling for
	(X & ~Y) | (~X & Y) and (X && !Y) | (!X && Y) optimization
	to (X ^ Y).

ChangeLog gcc/testsuite

2011-04-20  Kai Tietz

	* gcc.dg/binio-xor1.c: New test.
	* gcc.dg/binio-xor2.c: New test.
	* gcc.dg/binio-xor3.c: New test.
	* gcc.dg/binio-xor4.c: New test.
	* gcc.dg/binio-xor5.c: New test.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-pc-linux-gnu (multilib). Ok for apply?

Regards,
Kai

Attachment: opt_xor.txt
Description: Text document


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