From a442a050ad11c772f865980d578709af38d876e8 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 11 Jul 2016 19:58:48 +0930 Subject: [PATCH] [RS6000] Don't allow combine to form doloop pattern * config/rs6000/rs6000.md (UNSPEC_DOLOOP): New unspec. (ctr): Add unspec. (ctr_internal*): Likewise. From-SVN: r238207 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.md | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7dd0db561c2..0453adaf9ac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-07-11 Alan Modra + + * config/rs6000/rs6000.md (UNSPEC_DOLOOP): New unspec. + (ctr): Add unspec. + (ctr_internal*): Likewise. + 2016-07-08 James Bowman * config/ft32/ft32.c (ft32_elf_encode_section_info): New function. diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 7d9c6600f2a..5d212dd8180 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -148,6 +148,7 @@ UNSPEC_IEEE128_MOVE UNSPEC_IEEE128_CONVERT UNSPEC_SIGNBIT + UNSPEC_DOLOOP ]) ;; @@ -12185,6 +12186,7 @@ (set (match_dup 0) (plus:P (match_dup 0) (const_int -1))) + (unspec [(const_int 0)] UNSPEC_DOLOOP) (clobber (match_scratch:CC 2 "")) (clobber (match_scratch:P 3 ""))])] "" @@ -12195,6 +12197,7 @@ ;; JUMP_INSNs. ;; For the length attribute to be calculated correctly, the ;; label MUST be operand 0. +;; The UNSPEC is present to prevent combine creating this pattern. (define_insn "*ctr_internal1" [(set (pc) @@ -12205,6 +12208,7 @@ (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*wi*c*l") (plus:P (match_dup 1) (const_int -1))) + (unspec [(const_int 0)] UNSPEC_DOLOOP) (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) (clobber (match_scratch:P 4 "=X,X,&r,r"))] "" @@ -12229,6 +12233,7 @@ (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*wi*c*l") (plus:P (match_dup 1) (const_int -1))) + (unspec [(const_int 0)] UNSPEC_DOLOOP) (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) (clobber (match_scratch:P 4 "=X,X,&r,r"))] "" @@ -12255,6 +12260,7 @@ (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*wi*c*l") (plus:P (match_dup 1) (const_int -1))) + (unspec [(const_int 0)] UNSPEC_DOLOOP) (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) (clobber (match_scratch:P 4 "=X,X,&r,r"))] "" @@ -12279,6 +12285,7 @@ (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*wi*c*l") (plus:P (match_dup 1) (const_int -1))) + (unspec [(const_int 0)] UNSPEC_DOLOOP) (clobber (match_scratch:CC 3 "=X,&x,&x,&x")) (clobber (match_scratch:P 4 "=X,X,&r,r"))] "" @@ -12305,6 +12312,7 @@ (match_operand 6 "" ""))) (set (match_operand:P 0 "int_reg_operand" "") (plus:P (match_dup 1) (const_int -1))) + (unspec [(const_int 0)] UNSPEC_DOLOOP) (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:P 4 ""))] "reload_completed" @@ -12330,6 +12338,7 @@ (match_operand 6 "" ""))) (set (match_operand:P 0 "nonimmediate_operand" "") (plus:P (match_dup 1) (const_int -1))) + (unspec [(const_int 0)] UNSPEC_DOLOOP) (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:P 4 ""))] "reload_completed && ! gpc_reg_operand (operands[0], SImode)" -- 2.30.2