summaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-24 07:01:52 +0000
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-24 07:01:52 +0000
commitdae9d0e7becfb34379574c1eb94f9a869da2d371 (patch)
tree72bb3196b127f80e7d5b368328aa2ae12e943abc /gcc/recog.c
parentc3e972932b3995f43c16a9c50ebb2bb1af7f866c (diff)
downloadgcc-dae9d0e7becfb34379574c1eb94f9a869da2d371.tar.gz
2012-04-24 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* recog.c (insn_invalid_p): Add IN_GROUP parameter and use validate_change to add clobbers if IN_GROUP is nonzero. (verify_changes): Call insn_invalid_p with IN_GROUP set to true. * recog.h (insn_invalid_p): Add IN_GROUP parameter to function prototype. * gcse.c (process_insert_insn): Call insn_invalid_p with IN_GROUP set to false. * config/s390/s390.c (insn_invalid_p): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186748 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index 8f041799e62..cb2bfd31701 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -309,10 +309,14 @@ canonicalize_change_group (rtx insn, rtx x)
/* This subroutine of apply_change_group verifies whether the changes to INSN
- were valid; i.e. whether INSN can still be recognized. */
+ were valid; i.e. whether INSN can still be recognized.
+
+ If IN_GROUP is true clobbers which have to be added in order to
+ match the instructions will be added to the current change group.
+ Otherwise the changes will take effect immediately. */
int
-insn_invalid_p (rtx insn)
+insn_invalid_p (rtx insn, bool in_group)
{
rtx pat = PATTERN (insn);
int num_clobbers = 0;
@@ -344,7 +348,10 @@ insn_invalid_p (rtx insn)
newpat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (num_clobbers + 1));
XVECEXP (newpat, 0, 0) = pat;
add_clobbers (newpat, icode);
- PATTERN (insn) = pat = newpat;
+ if (in_group)
+ validate_change (insn, &PATTERN (insn), newpat, 1);
+ else
+ PATTERN (insn) = pat = newpat;
}
/* After reload, verify that all constraints are satisfied. */
@@ -413,7 +420,7 @@ verify_changes (int num)
}
else if (DEBUG_INSN_P (object))
continue;
- else if (insn_invalid_p (object))
+ else if (insn_invalid_p (object, true))
{
rtx pat = PATTERN (object);