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]

[fixed-point] Patch to change the handling of integer 1 and 1.0


Hi,

  This patch changes the handling of integer 1 and floating-point
1.0 for fract types.  Also, the handling of ++ and -- for
signed fract types is changed to generate correct results
based on the Embedded-C spec.  

  Two tests are updated due to these changes.  Thanks!

Regards,
Chao-ying

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

	* doc/extend.texi (Fixed-Point): Change "integer suffix" to
	"fixed-suffix".
	* c-typeck.c (c_common_type): Reduce ibit1 and ibit2 by 1 for signed
	integer types.
	(build_unary_op): Process ++ and -- for fract types to invert
	code and change inc from 1 to -1.
	* fixed-value.c (fixed_convert_from_real): Floating-point 1.0 should
	overflow if SATP is false.
	* convert.c (convert_to_fixed): We can convert integer 1 to accum
	types, but not to fract types.


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

	* gcc.dg/fixed-ponit/unary.c (FRACT_INCDEC): New to test signed fract
	types correctly.
	(main): Remove INCDEC tests for sat/non-sat signed/unsigned fract types.
	Add FRACT_INCDEC tests.
	* gcc.dg/fixed-ponit/const-1.c: Integer 1 and floating-point 1.0
	yield overflow warnings.

Attachment: gcc.diff
Description: gcc.diff


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