public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35397]  New: Problem handling denormalized numbers under AIX
@ 2008-02-28  9:02 efernandez at physiomics-plc dot com
  2008-02-28 17:05 ` [Bug target/35397] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: efernandez at physiomics-plc dot com @ 2008-02-28  9:02 UTC (permalink / raw)
  To: gcc-bugs

I face a problem when trying to convert string to double numbers, when the
string represents a denormalized number.

I use g++ 4.2.2 on powerpc-ibm-aix5.3.0.0.

Example:
-------------
#include <vector>
#include <sstream>
#include <iostream>

int main() {
  std::stringstream stream("5.6 0 0.205867 1.0809 7.22644 0.373206
-5.84675e-317 1.99995 0.00433641 1.45331e-45");
  std::vector<double> vals;
  double x;
  while (stream >> x) 
    {
      vals.push_back(x);
    }
  std::vector<double>::iterator it;
  for (it=vals.begin(); it<vals.end(); it++) {
    std::cout<<*it << " ";
  }
  return 0;
}
------------------

displays: 5.6 0 0.205867 1.0809 7.22644 0.373206
The denormalized number -5.84675e-317 is dropped and the loop ends.

Interestingly, if I use:
--------------
double x;
std::string st;
  while (stream >> st) {
      x = atof(st.c_str());
      vals.push_back(x);
    }
-------------

then that works, this displays: 5.6 0 0.205867 1.0809 7.22644 0.373206
-5.84675e-317 1.99995 0.00433641 1.45331e-45

I have seen there were some denormalized-related options for g++ on Alpha, but
they are not implemented on AIX. Moreover, I don't see this issue under
Linux/gcc 4.2.2.


-- 
           Summary: Problem handling denormalized numbers under AIX
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: efernandez at physiomics-plc dot com
  GCC host triplet: powerpc-ibm-aix5.3.0.0
GCC target triplet: powerpc-ibm-aix5.3.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35397


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/35397] Problem handling denormalized numbers under AIX
  2008-02-28  9:02 [Bug c++/35397] New: Problem handling denormalized numbers under AIX efernandez at physiomics-plc dot com
@ 2008-02-28 17:05 ` pinskia at gcc dot gnu dot org
  2008-08-04  0:00 ` dje at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-02-28 17:05 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal
          Component|c++                         |target


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35397


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/35397] Problem handling denormalized numbers under AIX
  2008-02-28  9:02 [Bug c++/35397] New: Problem handling denormalized numbers under AIX efernandez at physiomics-plc dot com
  2008-02-28 17:05 ` [Bug target/35397] " pinskia at gcc dot gnu dot org
@ 2008-08-04  0:00 ` dje at gcc dot gnu dot org
  2008-08-13 14:12 ` efernandez at physiomics-plc dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-08-04  0:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dje at gcc dot gnu dot org  2008-08-03 23:59 -------
This is fixed in G++ 4.3, probably due to a libstdc++ fix.


-- 

dje at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at gcc dot gnu dot org
             Status|UNCONFIRMED                 |RESOLVED
      Known to fail|                            |4.0.3 4.1.1 4.2.3
      Known to work|                            |4.3.0 4.3.1
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35397


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/35397] Problem handling denormalized numbers under AIX
  2008-02-28  9:02 [Bug c++/35397] New: Problem handling denormalized numbers under AIX efernandez at physiomics-plc dot com
  2008-02-28 17:05 ` [Bug target/35397] " pinskia at gcc dot gnu dot org
  2008-08-04  0:00 ` dje at gcc dot gnu dot org
@ 2008-08-13 14:12 ` efernandez at physiomics-plc dot com
  2008-08-13 15:20 ` dje at gcc dot gnu dot org
  2008-09-01 14:10 ` efernandez at physiomics-plc dot com
  4 siblings, 0 replies; 6+ messages in thread
From: efernandez at physiomics-plc dot com @ 2008-08-13 14:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from efernandez at physiomics-plc dot com  2008-08-13 14:11 -------
Will the fix be backported to the 4.2 branch ?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35397


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/35397] Problem handling denormalized numbers under AIX
  2008-02-28  9:02 [Bug c++/35397] New: Problem handling denormalized numbers under AIX efernandez at physiomics-plc dot com
                   ` (2 preceding siblings ...)
  2008-08-13 14:12 ` efernandez at physiomics-plc dot com
@ 2008-08-13 15:20 ` dje at gcc dot gnu dot org
  2008-09-01 14:10 ` efernandez at physiomics-plc dot com
  4 siblings, 0 replies; 6+ messages in thread
From: dje at gcc dot gnu dot org @ 2008-08-13 15:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dje at gcc dot gnu dot org  2008-08-13 15:18 -------
I, personally, am not sure what libstdc++ patch fixed the problem to know what
to backport.  GCC 4.2 is getting late in the release cycle and probably too
late to backport fixes like this, but I will ask.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35397


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/35397] Problem handling denormalized numbers under AIX
  2008-02-28  9:02 [Bug c++/35397] New: Problem handling denormalized numbers under AIX efernandez at physiomics-plc dot com
                   ` (3 preceding siblings ...)
  2008-08-13 15:20 ` dje at gcc dot gnu dot org
@ 2008-09-01 14:10 ` efernandez at physiomics-plc dot com
  4 siblings, 0 replies; 6+ messages in thread
From: efernandez at physiomics-plc dot com @ 2008-09-01 14:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from efernandez at physiomics-plc dot com  2008-09-01 14:09 -------
Thanks David. Would that be worth it to make it appear in the regression list?
How can it be added to that bug list?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35397


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-01 14:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-28  9:02 [Bug c++/35397] New: Problem handling denormalized numbers under AIX efernandez at physiomics-plc dot com
2008-02-28 17:05 ` [Bug target/35397] " pinskia at gcc dot gnu dot org
2008-08-04  0:00 ` dje at gcc dot gnu dot org
2008-08-13 14:12 ` efernandez at physiomics-plc dot com
2008-08-13 15:20 ` dje at gcc dot gnu dot org
2008-09-01 14:10 ` efernandez at physiomics-plc dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).