Bug 657606 - g++ 4.5.1 internal compiler error: Segmentation fault compiling libdecnumber
Summary: g++ 4.5.1 internal compiler error: Segmentation fault compiling libdecnumber
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 14
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-26 19:28 UTC by triumphs3
Modified: 2010-12-13 08:41 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-09 11:28:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 46862 0 None None None Never

Description triumphs3 2010-11-26 19:28:38 UTC
Description of problem:

Internal compiler error while compiling libdecnumber (decimal floating point library).

  
Version-Release number of selected component (if applicable):
gcc-c++-4.5.1-4 and 4.6.x on F14

How to reproduce:
Test-case:
//Begin t.C
#include <iostream>
namespace std {
  namespace decimal {
     template <class _Fmt> struct _FmtTraits;
     class decimal32;
     template <class _T> struct _Is_decimal_fp_aux {  static const bool value = false; };
     template <> struct _Is_decimal_fp_aux<decimal32> { static const bool value = true; };
     template <class _Tr> class _DecBase { };
     class decimal32 : public _DecBase<_FmtTraits<decimal32> > { };
  }
}
//end t.C


Steps to Reproduce:
1. g++ -c t.C
  
Actual results:
t.C:8:83: internal compiler error: Segmentation fault

Please submit a full bug report,with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.  

Expected results:
Clean compile.

Additional info:
If I remove <iostream> it compiles. If I remove the nested namespace decimal it compiles.

Comment 1 Jakub Jelinek 2010-12-09 11:28:10 UTC
This is invalid testcase, std::decimal::decimal{32,64,128} must have a field (the corresponding typedef float __decfloat32 __attribute__((mode(SD))); (or DD or TD).
If this is the latest libdecnumber, then it needs to be fixed.

That said, gcc shouldn't ICE on invalid sources, so I've filed an upstream bug.

Comment 2 triumphs3 2010-12-09 20:52:44 UTC
(In reply to comment #1)
> This is invalid testcase, std::decimal::decimal{32,64,128} must have a field
> (the corresponding typedef float __decfloat32 __attribute__((mode(SD))); (or DD
> or TD).
> If this is the latest libdecnumber, then it needs to be fixed.
> 
> That said, gcc shouldn't ICE on invalid sources, so I've filed an upstream bug.


I believe that is backwards.  The testcase is valid and the compiler should be fixed.  Your argument is that the name std::decimal::decimal32 is reserved by the implementation and only the may provide the definition of std::decimal::decimal32.  std::string is not reserved by the implementation and one is certainly free to use stlports std::string if they choose.  

The "typedef float __decfloat32 __attribute__((mode(SD)));" inside of the class std::decimal::decimal32 is an implementation detail specific to the implementatio n of decimal32 that is provided by g++ but is certainly not a requirement for an alternative decimal32 implementation.

Comment 3 Jakub Jelinek 2010-12-13 08:41:31 UTC
That view conflicts with the C++ ABI requirement:
http://www.codesourcery.com/archives/cxx-abi-dev/msg02174.html


Note You need to log in before you can comment on or make changes to this bug.