Bug 9108

Summary: [sparc] Illegal instruction code generation for operator=
Product: gcc Reporter: komiyama
Component: targetAssignee: Eric Botcazou <ebotcazou>
Status: RESOLVED DUPLICATE    
Severity: normal CC: ebotcazou, gcc-bugs
Priority: P3    
Version: 3.2.1   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description komiyama 2002-12-30 06:36:01 UTC
class test {

public:
  test  () {}; 
  ~test () {}; 

  test operator=(const test& right );
};

int main (void) {
    test* g;
    *g = test(); // this line cause problem
}

When compile with :g++ -O2 -mv8 test.cc -c -o test.o
It complain about 

/usr/ccs/bin/as: "/var/tmp//ccDsfW1g.s", line 19: error: missing branch conditional code
/usr/ccs/bin/as: "/var/tmp//ccDsfW1g.s", line 19: error: statement syntax

Because in assembly code,

26  .LLEHB1:
27          call    _ZN3ZDDaSERKS_, 0
28          mov     %l0, %o2
29          call    _ZN3ZDDD1Ev, 0
30          mov     %i0, %o0
31  .LLEHE1:
32          ba,pt,a %xcc, .LL7     <----- Here
33  .LL10:
34          call    _ZN3ZDDD1Ev, 0

It generate "ba,pt,a %xcc, .LL7" for operator= ,
but in SparcV9 architecture, it seems that it should be
 ba,a,pt %xcc, .LL7 
    ^^^^^

Release:
3.2.1

Environment:
sparcv9-sun-solaris2.8

How-To-Repeat:
Compile above sample with
 -O2 -mv8 

( without -O2, this error does not happen )
Comment 1 Eric Botcazou 2003-03-27 10:46:00 UTC
*** This bug has been marked as a duplicate of 10067 ***