This is the mail archive of the gcc-patches@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]

S/390: Fix incorrect insn attributes


Hello,

this patch fixes incorrect insn attributes that would cause
incorrect insn addresses to be computed, which could in some
rare cases cause shorten_branches to select the wrong type of
branch, leading to assembler aborts.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.

Mark, I'd like to check a modified version of this patch also
into the 3.2 branch, as it fixes a (rare but) serious bug and
can hardly have bad side effects ...

OK with you?


ChangeLog:

      * config/s390/s390.md ("*movdi_64"): Fix op_type attribute.
      ("*movdf_64"): Likewise.
      ("*lshrdi3_64"): Likewise.
      ("blockage"): Add length attribute.
      ("lit"): Likewise.



Index: gcc/config/s390/s390.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v
retrieving revision 1.36
diff -c -p -r1.36 s390.md
*** gcc/config/s390/s390.md   15 Oct 2002 16:27:34 -0000    1.36
--- gcc/config/s390/s390.md   22 Oct 2002 20:42:58 -0000
***************
*** 921,927 ****
     ld\\t%0,%1
     std\\t%1,%0
     mvc\\t%O0(8,%R0),%1"
!   [(set_attr "op_type" "RR,RXE,RXE,RR,RX,RX,SS")
     (set_attr "atype"   "reg,mem,mem,reg,mem,mem,mem")])

  (define_insn "*movdi_31"
--- 921,927 ----
     ld\\t%0,%1
     std\\t%1,%0
     mvc\\t%O0(8,%R0),%1"
!   [(set_attr "op_type" "RRE,RXE,RXE,RR,RX,RX,SS")
     (set_attr "atype"   "reg,mem,mem,reg,mem,mem,mem")])

  (define_insn "*movdi_31"
***************
*** 1197,1203 ****
     lg\\t%0,%1
     stg\\t%1,%0
     mvc\\t%O0(8,%R0),%1"
!   [(set_attr "op_type" "RR,RX,RX,RR,RXE,RXE,SS")
     (set_attr "atype"   "reg,mem,mem,reg,mem,mem,mem")])

  (define_insn "*movdf_31"
--- 1197,1203 ----
     lg\\t%0,%1
     stg\\t%1,%0
     mvc\\t%O0(8,%R0),%1"
!   [(set_attr "op_type" "RR,RX,RX,RRE,RXE,RXE,SS")
     (set_attr "atype"   "reg,mem,mem,reg,mem,mem,mem")])

  (define_insn "*movdf_31"
***************
*** 5514,5520 ****
    "@
     srlg\\t%0,%1,%c2
     srlg\\t%0,%1,0(%2)"
!   [(set_attr "op_type"  "RS,RS")])

  ;
  ; lshrsi3 instruction pattern(s).
--- 5514,5520 ----
    "@
     srlg\\t%0,%1,%c2
     srlg\\t%0,%1,0(%2)"
!   [(set_attr "op_type"  "RSE,RSE")])

  ;
  ; lshrsi3 instruction pattern(s).
***************
*** 6160,6166 ****
    [(unspec_volatile [(const_int 0)] 0)]
    ""
    ""
!   [(set_attr "type"    "none")])



--- 6160,6167 ----
    [(unspec_volatile [(const_int 0)] 0)]
    ""
    ""
!   [(set_attr "type"    "none")
!    (set_attr "length"  "0")])



***************
*** 6784,6789 ****
--- 6785,6791 ----
     return \"\";
  }"
    [(set_attr "op_type" "NN")
+    (set_attr "length"  "6")
     (set_attr "type"    "integer")])


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


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