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]

target/9496: [3.3] mips movstr scheduling bug


Is it OK to apply this patch (copied below) to 3.3:

    http://gcc.gnu.org/ml/gcc-patches/2002-11/msg01781.html

It fixes target/9496 (silent miscompilation on mips-linux-gnu).
I think it's a regression from earlier releases but I'm still
trying to check.

The patch should be safe because it just disables an optimising
define_split.  We have a conversion of the form:

        (set (mem:BLK ...)           (set (mem:BLK ...)
             (mem:BLK ...))   --->        (mem:BLK ...))
            ...                            ...
        (const_int 0)                (const_int1)

which loses the attributes of the original MEMs.

Tested by bootstrapping & regression testing on mips-sgi-irix6.5.
Sorry for not picking it up before now.

Richard


	* config/mips/mips.md: Disable the movstrsi define_split.

Index: config/mips/mips.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.md,v
retrieving revision 1.153.2.1
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.153.2.1 mips.md
*** config/mips/mips.md	3 Jan 2003 19:43:17 -0000	1.153.2.1
--- config/mips/mips.md	27 Feb 2003 22:17:58 -0000
*************** (define_insn ""
*** 6550,6555 ****
--- 6550,6561 ----
  ;; fill a delay slot.  This also prevents a bug in delayed branches
  ;; from showing up, which reuses one of the registers in our clobbers.
  
+ ;; ??? Disabled because it doesn't preserve alias information for
+ ;; operands 0 and 1.  Also, the rtl for the second insn doesn't mention
+ ;; that it uses the registers clobbered by the first.
+ ;;
+ ;; It would probably be better to split the block into individual
+ ;; instructions instead.
  (define_split
    [(set (mem:BLK (match_operand:SI 0 "register_operand" ""))
  	(mem:BLK (match_operand:SI 1 "register_operand" "")))
*************** (define_split
*** 6561,6567 ****
     (use (match_operand:SI 3 "small_int" ""))
     (use (const_int 0))]
  
!   "reload_completed && !TARGET_DEBUG_D_MODE && INTVAL (operands[2]) > 0"
  
    ;; All but the last move
    [(parallel [(set (mem:BLK (match_dup 0))
--- 6567,6573 ----
     (use (match_operand:SI 3 "small_int" ""))
     (use (const_int 0))]
  
!   "reload_completed && 0 && INTVAL (operands[2]) > 0"
  
    ;; All but the last move
    [(parallel [(set (mem:BLK (match_dup 0))


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