Bug 34880

Summary: gcc.c-torture/execute/float-floor.c fails for targets with no 64-bit double type
Product: gcc Reporter: Paulo Marques <pmarques>
Component: testsuiteAssignee: Not yet assigned to anyone <unassigned>
Severity: normal CC: eric.weddington, gcc-bugs
Priority: P3    
Version: 4.3.0   
Target Milestone: 4.3.2   
Host: i686-pc-linux-gnu Target: avr-*-*
Build: i686-pc-linux-gnu Known to work:
Known to fail: Last reconfirmed: 2008-04-12 15:51:36
Attachments: patch to allow target to set double type as unsupported
fix to float-floor.c

Description Paulo Marques 2008-01-20 03:48:29 UTC
gcc.c-torture/execute/float-floor.c depends on the target supporting an actual 64-bit double type.

Since the type "double" in the avr target is actually a 32-bit float, the test always fails.
Comment 1 Paulo Marques 2008-01-29 04:13:02 UTC
Created attachment 15045 [details]
patch to allow target to set double type as unsupported

with this patch, the target can simply add:

set_board_info no_double 1

to its configuration file, and the tests that use the "double" type are marked as unsupported instead of failing.

This way, only targets that want to skip these tests are affected and most targets will continue to run the tests as usual.
Comment 2 Paulo Marques 2008-01-30 01:03:36 UTC
Created attachment 15054 [details]
fix to float-floor.c

Marking all tests that use double as unsupported is actually overkill. The avr target supports "4 byte doubles" (the same as floats) that allows it to pass most tests that use the double type.

This patch fixes this test instead, which is the only test that fails from the gcc.c-torture/execute batch because of lack of 8 byte double support.

The patch leaves the test as is for most targets, only changing it for targets whose sizeof(double) is 4 or less.
Comment 3 Andy Hutchinson 2008-04-12 15:51:36 UTC
Confirmed on 4.3 - its always been bad.

Patch will need to be posted. But it works.
Comment 4 Janis Johnson 2008-05-13 22:10:10 UTC
Paulo, please send the patch from comment #2 to gcc-patches@gcc.gnu.org with an appropriate ChangeLog entry.  Let me know if you need help with that. 
Comment 5 Andy Hutchinson 2008-06-03 23:52:12 UTC
Fixed 4.4
Revision: 136344
Author: hutchinsonandy
Date: 7:46:07 PM, Tuesday, June 03, 2008
* gcc.c-torture/execute/float-floor.c: Adjust test for 4 byte doubles.
Modified : /trunk/gcc/testsuite/ChangeLog
Modified : /trunk/gcc/testsuite/gcc.c-torture/execute/float-floor.c