[ARM] Fix pr39501

Richard Earnshaw Richard.Earnshaw@buzzard.freeserve.co.uk
Sat Apr 4 10:46:00 GMT 2009


I suspect that there may be an underlying mid-end problem behind this
bug, but this patch fixes the problem here by disabling a pattern when
TARGET_HARD_FLOAT is not defined.  In that situation, the MIN_EXPR and
MAX_EXPR nodes are generated for float-point ?: operations (since we
don't have to worry about NaNs).  When these nodes are expanded, the
mid-end code seems to fail to take into account that the soft-float
comparison operations are allowed to return a bool rather than -ve,0,+ve
provided that FLOAT_LIB_COMPARE_RETURNS_BOOL is also defined.

I'll take a look into the mid-end problem shortly, when I have a bit
more spare time; but I need a patch that can safely be back-ported to
earlier branches (since this is a serious silent wrong-code bug) and
fixing the mid-end problem looks quite invasive.

tested on arm-none-eabi.

2009-04-04  Richard Earnshaw  <rearnsha@arm.com>

	PR target/39501
	* arm.md (movsfcc): Disable if not TARGET_HARD_FLOAT.
	* testsuite/gcc.c-torture/execute/pr39501.c: New file.
	* testsuite/gcc.c-torture/execute/pr39501.x: New file.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr39501.patch
Type: text/x-patch
Size: 3874 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090404/22c6bca9/attachment.bin>


More information about the Gcc-patches mailing list