summaryrefslogtreecommitdiff
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
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
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/s390/s390.c4
-rw-r--r--gcc/gcse.c2
-rw-r--r--gcc/recog.c15
-rw-r--r--gcc/recog.h2
5 files changed, 26 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8dbaeffd780..d37c609e701 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+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.
+
2012-04-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/53084
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index d6e250fd5a8..5592674e857 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -4413,7 +4413,7 @@ s390_expand_addcc (enum rtx_code cmp_code, rtx cmp_op0, rtx cmp_op1,
insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM),
gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1));
/* We use insn_invalid_p here to add clobbers if required. */
- ret = insn_invalid_p (emit_insn (insn));
+ ret = insn_invalid_p (emit_insn (insn), false);
gcc_assert (!ret);
/* Emit ALC instruction pattern. */
@@ -4485,7 +4485,7 @@ s390_expand_addcc (enum rtx_code cmp_code, rtx cmp_op0, rtx cmp_op1,
insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM),
gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1));
/* We use insn_invalid_p here to add clobbers if required. */
- ret = insn_invalid_p (emit_insn (insn));
+ ret = insn_invalid_p (emit_insn (insn), false);
gcc_assert (!ret);
/* Emit SLB instruction pattern. */
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 6f149bb402f..a050ff5ba6b 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -2087,7 +2087,7 @@ process_insert_insn (struct expr *expr)
{
rtx insn = emit_insn (gen_rtx_SET (VOIDmode, reg, exp));
- if (insn_invalid_p (insn))
+ if (insn_invalid_p (insn, false))
gcc_unreachable ();
}
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);
diff --git a/gcc/recog.h b/gcc/recog.h
index 71dfe2a68a9..9fb3443254a 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -79,7 +79,7 @@ extern int asm_operand_ok (rtx, const char *, const char **);
extern bool validate_change (rtx, rtx *, rtx, bool);
extern bool validate_unshare_change (rtx, rtx *, rtx, bool);
extern bool canonicalize_change_group (rtx insn, rtx x);
-extern int insn_invalid_p (rtx);
+extern int insn_invalid_p (rtx, bool);
extern int verify_changes (int);
extern void confirm_change_group (void);
extern int apply_change_group (void);