Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 8949
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Paolo Carlini <paolo.carlini@oracle.com>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: johnb@stl.sarov.ru
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
test18_2.cpp test18_2.cpp application/octet-stream 2003-05-21 15:17 321 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 8949 depends on: Show dependency tree
Show dependency graph
Bug 8949 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2002-12-15 06:46
I found some problems with numeric_limits class:

1. In case denormalization is not presented (numeric_limits<>::has_denorm == false) numeric_limits<float;double;long double>::denorm_min() should be equal to corresponding numeric_limits<float;double;long double>::min(). (minimum positive normalized value, see ISO|IEC 14882 14882 "C++" 18.2.1.2(49-51))

  As an effect there is:

2. numeric_limits<float;double;long double>::denorm_min()
should be > 0.0 as stated in ISO|IEC 10967-1 "Language Independend Arithmetic" (see also ISO|IEC 14882 "C++" 18.2.1.2(49-51))

3. Possibly I am wrong here, but please look also for is_iec559 member for short,int,long types, it looks that these types shouldn`t have it set to true.

See small testcase attached also.

Release:
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

Environment:
Red Hat Linux 8.0

How-To-Repeat:
Compile and run testcase with g++. You`ll see some failed messages.

------- Comment #1 From Paolo Carlini 2002-12-15 10:55 -------
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-Why: Analyzed.

------- Comment #2 From Paolo Carlini 2002-12-15 10:55 -------
State-Changed-From-To: open->analyzed
State-Changed-Why: First half (denorm_min()), already fixed for 3.3, it isn't
    a regression and probably the fix will not be backported
    to 3.2.x. Second half (is_iec559), confirmed everywhere as
    a bug in my reading (see 18.2.1.2, 53 and 18.2.1.5, 1),
    easy to patch as soon as the mainline reopens.

------- Comment #3 From Paolo Carlini 2002-12-16 11:56 -------
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3 and 3.4.

------- Comment #4 From Paolo Carlini 2002-12-16 19:52 -------
From: paolo@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: libstdc++/8949
Date: 16 Dec 2002 19:52:40 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	paolo@gcc.gnu.org	2002-12-16 11:52:38
 
 Modified files:
 	libstdc++-v3   : ChangeLog 
 	libstdc++-v3/testsuite/18_support: numeric_limits.cc 
 	libstdc++-v3/include/std: std_limits.h 
 
 Log message:
 	2002-12-16  Paolo Carlini  <pcarlini@unitus.it>
 	
 	PR libstdc++/8949
 	* include/std/std_limits.h
 	(struct numeric_limits<short>,
 	struct numeric_limits<unsigned short>,
 	struct numeric_limits<int>,
 	struct numeric_limits<unsigned int>,
 	struct numeric_limits<long>,
 	struct numeric_limits<unsigned long>,
 	struct numeric_limits<long long>,
 	struct numeric_limits<unsigned long long>): According
 	to 18.2.1.2,53 and 18.2.1.5,1 is_iec559 shall be false.
 	* testsuite/18_support/numeric_limits.cc: Add test04.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.1466&r2=1.1467
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/18_support/numeric_limits.cc.diff?cvsroot=gcc&r1=1.18&r2=1.19
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/std/std_limits.h.diff?cvsroot=gcc&r1=1.19&r2=1.20
 

------- Comment #5 From Paolo Carlini 2002-12-19 11:44 -------
From: paolo@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: libstdc++/8949
Date: 19 Dec 2002 11:44:31 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	paolo@gcc.gnu.org	2002-12-19 03:44:31
 
 Modified files:
 	libstdc++-v3   : ChangeLog 
 	libstdc++-v3/testsuite/18_support: numeric_limits.cc 
 	libstdc++-v3/include/std: std_limits.h 
 
 Log message:
 	2002-12-19  Paolo Carlini  <pcarlini@unitus.it>
 	
 	PR libstdc++/8949
 	* include/std/std_limits.h
 	(struct numeric_limits<short>,
 	struct numeric_limits<unsigned short>,
 	struct numeric_limits<int>,
 	struct numeric_limits<unsigned int>,
 	struct numeric_limits<long>,
 	struct numeric_limits<unsigned long>,
 	struct numeric_limits<long long>,
 	struct numeric_limits<unsigned long long>): According
 	to 18.2.1.2,53 and 18.2.1.5,1 is_iec559 shall be false.
 	* testsuite/18_support/numeric_limits.cc: Add test04.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.1464.2.1&r2=1.1464.2.2
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/18_support/numeric_limits.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.18&r2=1.18.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/std/std_limits.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.19&r2=1.19.4.1

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug