Bug 34880 - gcc.c-torture/execute/float-floor.c fails for targets with no 64-bit double type
Summary: gcc.c-torture/execute/float-floor.c fails for targets with no 64-bit double type
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.2
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2008-01-20 03:48 UTC by Paulo Marques
Modified: 2008-06-03 23:52 UTC (History)
2 users (show)

See Also:
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

patch to allow target to set double type as unsupported (303 bytes, patch)
2008-01-29 04:13 UTC, Paulo Marques
Details | Diff
fix to float-floor.c (230 bytes, patch)
2008-01-30 01:03 UTC, Paulo Marques
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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