Bug 22203 - std::numeric_limits<int>::traps is wrong on PPC
std::numeric_limits<int>::traps is wrong on PPC
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: libstdc++
4.0.0
: P2 normal
: 4.1.0
Assigned To: Paolo Carlini
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-27 18:32 UTC by Andrew Pinski
Modified: 2005-11-05 09:43 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc*-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-04 18:35:40


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-06-27 18:32:44 UTC
The followign program should not abort on PPC because PPC has no trapping instructions integer 
division instruction.
#include <limits>
extern "C" void abort(void);

int main(void)
{
  if ( std::numeric_limits<int>::traps)
   abort ();
}
Comment 1 paolo@gcc.gnu.org 2005-11-05 09:42:07 UTC
Subject: Bug 22203

Author: paolo
Date: Sat Nov  5 09:42:01 2005
New Revision: 106524

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106524
Log:
2005-11-05  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/22203
	* include/bits/c++config: Include cpu_defines.h.
	* include/Makefile.am: Add cpu_defines.h to host_headers.
	* configure.host: Add cpu_defines_dir.
	* configure.ac: Use it.
	* config/cpu/powerpc/cpu_defines.h: New.
	* config/cpu/generic/cpu_defines.h: Likewise.
	* configure: Regenerate.
	* Makefile.in: Likewise.
	* include/Makefile.in: Likewise.
	* libmath/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.	
	* testsuite/Makefile.in: Likewise.

Added:
    trunk/libstdc++-v3/config/cpu/generic/cpu_defines.h
    trunk/libstdc++-v3/config/cpu/powerpc/cpu_defines.h
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/Makefile.in
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/configure.ac
    trunk/libstdc++-v3/configure.host
    trunk/libstdc++-v3/include/Makefile.am
    trunk/libstdc++-v3/include/Makefile.in
    trunk/libstdc++-v3/include/bits/c++config
    trunk/libstdc++-v3/libmath/Makefile.in
    trunk/libstdc++-v3/libsupc++/Makefile.in
    trunk/libstdc++-v3/po/Makefile.in
    trunk/libstdc++-v3/src/Makefile.in
    trunk/libstdc++-v3/testsuite/Makefile.in

Comment 2 Paolo Carlini 2005-11-05 09:43:25 UTC
Fixed for 4.1.0.
Comment 3 Benjamin Kosnik 2005-11-10 02:05:19 UTC
Subject: Bug 22203

Author: bkoz
Date: Thu Nov 10 02:05:13 2005
New Revision: 106727

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106727
Log:
2005-11-09  Benjamin Kosnik  <bkoz@redhat.com>
	    Paolo Carlini  <pcarlini@suse.de>
            Gabriel Dos Reis  <gdr@integrable-solutions.net>

	PR libstdc++/22203
	* numeric_limits.cc: Split into...
	* numeric_limits/specialization.cc: ..this.
	* numeric_limits/is_iec559.cc: Same.
	* numeric_limits/sign.cc: Same.
	* numeric_limits/quiet_NaN.cc: Same.
	* numeric_limits/digits10.cc: Same.
	* numeric_limits/denorm_min.cc: Same.
	* numeric_limits/min_max.cc: Same.
	* numeric_limits/epsilon.cc: Same.
	* numeric_limits/infinity.cc: Same.
	* numeric_limits/traps.cc: New.


Added:
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/denorm_min.cc
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/digits10.cc
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/epsilon.cc
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/infinity.cc
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/is_iec559.cc
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/min_max.cc
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/quiet_NaN.cc
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/sign.cc
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/specialization.cc
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits/traps.cc
Removed:
    trunk/libstdc++-v3/testsuite/18_support/numeric_limits.cc
Modified:
    trunk/libstdc++-v3/ChangeLog