46 – Constant folding with long doubles

Bug 46 - Constant folding with long doubles
Summary: Constant folding with long doubles
Status: RESOLVED FIXED
Alias: None
Product: C/C++ compiler
Classification: Unclassified
Component: scppn (show other bugs)
Version: unspecified
Hardware: PC Windows
: P3 normal
Assignee: Walter Bright
URL:
Depends on:
Blocks:
Reported: 2009年12月11日 14:47 UTC by Walter Bright
Modified: 2010年05月16日 21:46 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Bright 2009年12月11日 14:47:34 UTC
Reported by Fred J. Tydeman
/* Fails */
#include <stdio.h>
#define LDBL long double
#define MIN_LDBL (0x1p-16382L)
#define DEN_LDBL (0x1p-16445L)
int main(void){
 LDBL ld1, ld2, ld3, ld4;
 ld1 = MIN_LDBL - DEN_LDBL;
 ld2 = MIN_LDBL;
 ld3 = DEN_LDBL;
 ld4 = ld2 - ld3;
 if( 0.L == ld1 ){
 (void)printf("Fail\n");
 }
 (void)printf("ld1=%Lg\n", ld1);
 (void)printf("ld2=%Lg\n", ld2);
 (void)printf("ld3=%Lg\n", ld3);
 (void)printf("ld4=%Lg\n", ld4);
 return 0;
}
Comment 1 Walter Bright 2010年05月16日 21:46:30 UTC
Fixed version 8.52


AltStyle によって変換されたページ (->オリジナル) /