From: Uros Bizjak Date: Wed, 29 Apr 2015 20:58:25 +0000 (+0200) Subject: re PR target/65871 (bzhi builtin/intrinsic wrongly assumes bzhi instruction doesn... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec4c68c8d01d99d2d818496be7db5fe939b6a674;p=gcc.git re PR target/65871 (bzhi builtin/intrinsic wrongly assumes bzhi instruction doesn't set the ZF flag) PR target/65871 * config/i386/i386.md (*bmi_bextr__cczonly): New pattern. (*bmi2_bzhi_3_1_cczonly): Ditto. (setcc+movzbl peephole2): Check also clobbered reg. (setcc+andl peephole2): Ditto. From-SVN: r222592 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3b363b04f72..3b1d2e7a6d8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -8,6 +8,8 @@ PR target/65871 * config/i386/i386.md (*bmi_bextr__cczonly): New pattern. (*bmi2_bzhi_3_1_cczonly): Ditto. + (setcc+movzbl peephole2): Check also clobbered reg. + (setcc+andl peephole2): Ditto. 2015-04-29 Thomas Schwinge diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 060ffa8ab84..5cac713e5a3 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -11567,7 +11567,9 @@ (zero_extend (match_dup 1)))] "(peep2_reg_dead_p (3, operands[1]) || operands_match_p (operands[1], operands[3])) - && ! reg_overlap_mentioned_p (operands[3], operands[0])" + && ! reg_overlap_mentioned_p (operands[3], operands[0]) + && ! (GET_CODE (operands[4]) == CLOBBER + && reg_mentioned_p (operands[3], operands[4]))" [(parallel [(set (match_dup 5) (match_dup 0)) (match_dup 4)]) (set (strict_low_part (match_dup 6)) @@ -11610,7 +11612,9 @@ (clobber (reg:CC FLAGS_REG))])] "(peep2_reg_dead_p (3, operands[1]) || operands_match_p (operands[1], operands[3])) - && ! reg_overlap_mentioned_p (operands[3], operands[0])" + && ! reg_overlap_mentioned_p (operands[3], operands[0]) + && ! (GET_CODE (operands[4]) == CLOBBER + && reg_mentioned_p (operands[3], operands[4]))" [(parallel [(set (match_dup 5) (match_dup 0)) (match_dup 4)]) (set (strict_low_part (match_dup 6))