Subject: port-sun3/34553: gcc -msoft-float with long double doesn't duplicate hard-float
To: None <,,>
From: None <>
List: netbsd-bugs
Date: 09/18/2006 17:35:00
>Number:         34553
>Category:       port-sun3
>Synopsis:       gcc -msoft-float with long double doesn't duplicate hard-float
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sun3-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 18 17:35:00 +0000 2006
>Originator:     Arthur Townsend
>Release:        3.0
3.0 for sun3, crosscompiled on NetBSD 3.0 i386, with MKSOFTFLOAT in /etc/mk.conf and --nfp added to /usr/src/tools gcc makefile.
when compiling with -msoft-float, floats work, and doubles work, but long doubles don't work (variables declared as long doubles and set to the same thing are shown as not equal).  The softfloat web-site: says that "SoftFloat's code for the extended double-precision and quadruple-precision formats depends on the existence of a 64-bit integer type in C. If the C compiler used to compile SoftFloat does not support 64-bit integers, SoftFloat will be limited to single and double precisions only." but gcc 3.3.3 for netbsd sun3 has "long long" for 64-bits, so I expect that long double would produce the same results as float/double.
The following code compiled with "gcc" doesn't print anything.  When compiled with "-msoft-float", it prints "NOT equal".  If "long double" is changed to float or double, then -msoft-float and regular hard-float compile produce identical results (no output).

#include <stdio.h>

int main()
long double a=1.1;
long double b=1.1;

 if (a != b) printf("NOT equal\n");