aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2013-11-12 21:33:06 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2013-11-12 21:33:06 +0000
commit8eb2533ac6e1576d2e4414a9d6657e4c2d74e94a (patch)
treecfd866a718ae2d275b650c94309178f9039f6732
parent7f6ada80ce8db681c72269f598cefb3c8ca236e0 (diff)
downloadgcc-8eb2533ac6e1576d2e4414a9d6657e4c2d74e94a.zip
gcc-8eb2533ac6e1576d2e4414a9d6657e4c2d74e94a.tar.gz
gcc-8eb2533ac6e1576d2e4414a9d6657e4c2d74e94a.tar.bz2
re PR other/58712 (issues found by --enable-checking=valgrind)
2013-11-12 Vladimir Makarov <vmakarov@redhat.com> PR other/58712 * ira-costs.c (record_operand_costs): Check operands number for the single set. From-SVN: r204720
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ira-costs.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 97ad345..fd9ca26 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-12 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR other/58712
+ * ira-costs.c (record_operand_costs): Check operands number for
+ the single set.
+
2013-11-12 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/59054
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index 424b99c..d7299e6 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -1224,6 +1224,9 @@ record_operand_costs (rtx insn, enum reg_class *pref)
preferred class is very expensive as the source of a copy
instruction. */
if ((set = single_set (insn)) != NULL_RTX
+ /* In rare cases the single set insn might have less 2 operands
+ as the source can be a fixed special reg. */
+ && recog_data.n_operands > 1
&& ops[0] == SET_DEST (set) && ops[1] == SET_SRC (set))
{
int regno, other_regno;