This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9306: ICE


>Number:         9306
>Category:       c++
>Synopsis:       ICE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 14 04:06:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     shrinivasa@kpit.com
>Release:        GCC 3.2.1. Also observed in GCC 3.2
>Organization:
>Environment:
SH-COFF.
>Description:
When attached file is compiled with  -O2 -g the compiler generates ICE. Try following command.

sh-coff-g++ -S -g -O2 test_code.cpp

-------------------------------------
typedef int int32;
typedef int32 real_const_t;

class real
{
private:
  int32 value;

public:
  real(void) {}
  real(const real & z_a) {value = z_a.value;}
  friend real operator+ (real, real);
};

inline real operator+ (real z_a, real z_b)
{
  real temp;
  temp.value = (z_a.value) + (z_b.value);
  return temp;
}

real r,r1,r2,r3;

void test (void)
{
       r = r1 + r2 + r3;
}
-----------------------------------------------
>How-To-Repeat:
Compile attached file with command line 
> > sh-coff-g++ -S -g -O2 test_code.cpp
>Fix:
I dont have the fix.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]