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]

polished version of valgrind fix


Fri Nov 15 18:26:46 CET 2002  Jan Hubicka  <jh@suse.cz>
	* i386.md (length_immediate): Do not refer to insn address.
	(jcc*, jmp patterns):  Compute length explicitly.
Index: i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.401
diff -c -3 -p -r1.401 i386.md
*** i386.md	31 Oct 2002 15:21:22 -0000	1.401
--- i386.md	15 Nov 2002 13:51:26 -0000
***************
*** 187,199 ****
  	   (if_then_else (match_operand 1 "constant_call_address_operand" "")
  	     (const_int 4)
  	     (const_int 0))
  	 (eq_attr "type" "ibr")
! 	   (if_then_else (and (ge (minus (match_dup 0) (pc))
! 				  (const_int -128))
! 			      (lt (minus (match_dup 0) (pc))
! 				  (const_int 124)))
! 	     (const_int 1)
! 	     (const_int 4))
  	 ]
  	 (symbol_ref "/* Update immediate_length and other attributes! */
  		      abort(),1")))
--- 187,196 ----
  	   (if_then_else (match_operand 1 "constant_call_address_operand" "")
  	     (const_int 4)
  	     (const_int 0))
+ 	 ;; We don't know the size before shorten_branches.  Expect
+ 	 ;; the instruction to fit for better scheduling.
  	 (eq_attr "type" "ibr")
! 	   (const_int 1)
  	 ]
  	 (symbol_ref "/* Update immediate_length and other attributes! */
  		      abort(),1")))
***************
*** 12837,12849 ****
    "%+j%C1\t%l0"
    [(set_attr "type" "ibr")
     (set_attr "modrm" "0")
!    (set (attr "prefix_0f")
  	   (if_then_else (and (ge (minus (match_dup 0) (pc))
  				  (const_int -128))
  			      (lt (minus (match_dup 0) (pc))
  				  (const_int 124)))
! 	     (const_int 0)
! 	     (const_int 1)))])
  
  (define_insn "*jcc_2"
    [(set (pc)
--- 12834,12846 ----
    "%+j%C1\t%l0"
    [(set_attr "type" "ibr")
     (set_attr "modrm" "0")
!    (set (attr "length")
  	   (if_then_else (and (ge (minus (match_dup 0) (pc))
  				  (const_int -128))
  			      (lt (minus (match_dup 0) (pc))
  				  (const_int 124)))
! 	     (const_int 2)
! 	     (const_int 6)))])
  
  (define_insn "*jcc_2"
    [(set (pc)
***************
*** 12855,12867 ****
    "%+j%c1\t%l0"
    [(set_attr "type" "ibr")
     (set_attr "modrm" "0")
!    (set (attr "prefix_0f")
  	   (if_then_else (and (ge (minus (match_dup 0) (pc))
  				  (const_int -128))
  			      (lt (minus (match_dup 0) (pc))
  				  (const_int 124)))
! 	     (const_int 0)
! 	     (const_int 1)))])
  
  ;; In general it is not safe to assume too much about CCmode registers,
  ;; so simplify-rtx stops when it sees a second one.  Under certain 
--- 12852,12864 ----
    "%+j%c1\t%l0"
    [(set_attr "type" "ibr")
     (set_attr "modrm" "0")
!    (set (attr "length")
  	   (if_then_else (and (ge (minus (match_dup 0) (pc))
  				  (const_int -128))
  			      (lt (minus (match_dup 0) (pc))
  				  (const_int 124)))
! 	     (const_int 2)
! 	     (const_int 6)))])
  
  ;; In general it is not safe to assume too much about CCmode registers,
  ;; so simplify-rtx stops when it sees a second one.  Under certain 
***************
*** 13122,13127 ****
--- 13119,13131 ----
    ""
    "jmp\t%l0"
    [(set_attr "type" "ibr")
+    (set (attr "length")
+ 	   (if_then_else (and (ge (minus (match_dup 0) (pc))
+ 				  (const_int -128))
+ 			      (lt (minus (match_dup 0) (pc))
+ 				  (const_int 124)))
+ 	     (const_int 2)
+ 	     (const_int 5)))
     (set_attr "modrm" "0")])
  
  (define_expand "indirect_jump"
***************
*** 13248,13261 ****
  			            (const_int 124))))
  		      (const_int 2)
  		      (const_int 16)))
!    (set (attr "type")
! 	(if_then_else (and (eq_attr "alternative" "0")
! 			   (and (ge (minus (match_dup 0) (pc))
! 			            (const_int -128))
! 			        (lt (minus (match_dup 0) (pc))
! 			            (const_int 124))))
! 		      (const_string "ibr")
! 		      (const_string "multi")))])
  
  (define_split
    [(set (pc)
--- 13252,13260 ----
  			            (const_int 124))))
  		      (const_int 2)
  		      (const_int 16)))
!    ;; We don't know the type before shorten branches.  Optimistically expect
!    ;; the loop instruction to match.
!    (set (attr "type") (const_string "ibr"))])
  
  (define_split
    [(set (pc)


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