[fixed-point] Patch to disable association for saturating types

Fu, Chao-Ying fu@mips.com
Fri Mar 30 04:00:00 GMT 2007


Hi,

  This patch updates constant folding to not associate operations
for saturating types, because it affects the result.
One new test is added.  Thanks!

Regards,
Chao-ying

gcc/ChangeLog
2007-03-29  Chao-ying Fu  <fu@mips.com>

	* fold-const.c (split_tree): Support FIXED_CST.
	(operand_equal_p): Support FIXED_CST.
	(fold_binary): Make sure the type is not saturating, before
	associating operations.  Ex: A + B + C, A * B * C,
	(A1 * C1) +/- (A2 * C2).

gcc/testsuite/ChangeLog
2007-03-29  Chao-ying Fu  <fu@mips.com>

        * gcc.dg/fixed-ponit/noassoc.c: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc.diff
Type: application/octet-stream
Size: 3066 bytes
Desc: gcc.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070330/cf82eee5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: noassoc.c
Type: application/octet-stream
Size: 1058 bytes
Desc: noassoc.c
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070330/cf82eee5/attachment-0001.obj>


More information about the Gcc-patches mailing list