sparc.md generates invalid opcode

John Carr jfc@tiac.net
Mon Aug 10 16:04:00 GMT 1998


The new sparc.md generates the opcode "b,pt %xcc" which causes the Solaris
2.6 assembler to dump core.  This patch fixes the problem by changing
"b,pt" to "ba,pt".  Also, since the only processor with the b,a bug is
TurboSPARC the patch eliminates the bug workaround for V9.

*** sparc.md~	Mon Aug 10 09:38:16 1998
--- sparc.md	Mon Aug 10 18:58:11 1998
***************
*** 6535,6553 ****
    ""
    "*
  {
!   /* Some implementations (e.g. TurboSparc) are reported to have problems
!      with
  	foo: b,a foo
       i.e. an empty loop with the annul bit set.  The workaround is to use 
          foo: b foo; nop
       instead.  */
  
!   if (flag_delayed_branch
        && (insn_addresses[INSN_UID (operands[0])]
  	  == insn_addresses[INSN_UID (insn)]))
!     return TARGET_V9 ? \"b,pt\\t%%xcc, %l0%#\" : \"b\\t%l0%#\";
    else
!     return TARGET_V9 ? \"b,pt%*\\t%%xcc, %l0%(\" : \"b%*\\t%l0%(\";
  }"
    [(set_attr "type" "uncond_branch")])
  
--- 6545,6562 ----
    ""
    "*
  {
!   /* TurboSparc is reported to have problems with
  	foo: b,a foo
       i.e. an empty loop with the annul bit set.  The workaround is to use 
          foo: b foo; nop
       instead.  */
  
!   if (! TARGET_V9 && flag_delayed_branch
        && (insn_addresses[INSN_UID (operands[0])]
  	  == insn_addresses[INSN_UID (insn)]))
!     return \"b\\t%l0%#\";
    else
!     return TARGET_V9 ? \"ba,pt%*\\t%%xcc, %l0%(\" : \"b%*\\t%l0%(\";
  }"
    [(set_attr "type" "uncond_branch")])
  




More information about the Gcc-patches mailing list