summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-25 08:31:22 +0000
committeramker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-25 08:31:22 +0000
commit7da9b5e4bbe6c13863e308f8735810bff93379ac (patch)
treec3f330e9c0fa90138c5a86b8865d315e0d6919cf
parent8b3e57388de217cf04f675e479cdc854d381d73d (diff)
downloadgcc-7da9b5e4bbe6c13863e308f8735810bff93379ac.tar.gz
PR target/81414
* config/aarch64/cortex-a57-fma-steering.c (analyze): Skip fmul/fmac instructions if no du chain is found. gcc/testsuite * gcc.target/aarch64/pr81414.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250496 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/aarch64/cortex-a57-fma-steering.c15
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr81414.C9
4 files changed, 31 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3ff7b902b4a..24d9088b3f7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-07-25 Bin Cheng <bin.cheng@arm.com>
+
+ PR target/81414
+ * config/aarch64/cortex-a57-fma-steering.c (analyze): Skip fmul/fmac
+ instructions if no du chain is found.
+
2017-07-25 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr-log.c (avr_log_vadump) ['T']: Print NULL-TREE.
diff --git a/gcc/config/aarch64/cortex-a57-fma-steering.c b/gcc/config/aarch64/cortex-a57-fma-steering.c
index 6d90acdd4a2..fa8c56aab02 100644
--- a/gcc/config/aarch64/cortex-a57-fma-steering.c
+++ b/gcc/config/aarch64/cortex-a57-fma-steering.c
@@ -973,10 +973,17 @@ func_fma_steering::analyze ()
break;
}
- /* We didn't find a chain with a def for this instruction. */
- gcc_assert (i < dest_op_info->n_chains);
-
- this->analyze_fma_fmul_insn (forest, chain, head);
+ /* Due to implementation of regrename, dest register can slip away
+ from regrename's analysis. As a result, there is no chain for
+ the destination register of insn. We simply skip the insn even
+ it is a fmul/fmac instruction. This can happen when the dest
+ register is also a source register of insn and one of the below
+ conditions is satisfied:
+ 1) the source reg is setup in larger mode than this insn;
+ 2) the source reg is uninitialized;
+ 3) the source reg is passed in as parameter. */
+ if (i < dest_op_info->n_chains)
+ this->analyze_fma_fmul_insn (forest, chain, head);
}
}
free (bb_dfs_preorder);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 82119f104dd..aef24ec7a77 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-25 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/81414
+ * gcc.target/aarch64/pr81414.C: New.
+
2017-07-25 Richard Biener <rguenther@suse.de>
PR middle-end/81505
diff --git a/gcc/testsuite/gcc.target/aarch64/pr81414.C b/gcc/testsuite/gcc.target/aarch64/pr81414.C
new file mode 100644
index 00000000000..53dfc7cf800
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr81414.C
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mcpu=cortex-a57" } */
+
+typedef __Float32x2_t float32x2_t;
+float32x2_t
+foo1 (float32x2_t __a, float32x2_t __b, float32x2_t __c) {
+ return __b * __c + __a;
+}
+