summaryrefslogtreecommitdiff
path: root/gcc/fwprop.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-12 08:56:14 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-07-12 08:56:14 +0000
commit9aece49ef83b9e01c42a510d0846e6c25eab6501 (patch)
treef56347f8c8d0b7fbfa050d2666f224d5c7a5511b /gcc/fwprop.c
parenta3ebe2af8065fe3992c6e28377fb0f4f78a4c03e (diff)
downloadgcc-9aece49ef83b9e01c42a510d0846e6c25eab6501.tar.gz
2016-07-12 Richard Biener <rguenther@suse.de>
PR rtl-optimization/68961 * fwprop.c (propagate_rtx): Allow SUBREGs of VEC_CONCAT and CONCAT to simplify to a non-constant. * gcc.target/i386/pr68961.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238238 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fwprop.c')
-rw-r--r--gcc/fwprop.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index 7834bca7f51..88cfefbe1ef 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -619,6 +619,15 @@ propagate_rtx_1 (rtx *px, rtx old_rtx, rtx new_rtx, int flags)
*px = tem;
+ /* Allow replacements that simplify operations on a vector or complex
+ value to a component. The most prominent case is
+ (subreg ([vec_]concat ...)). */
+ if (REG_P (tem) && !HARD_REGISTER_P (tem)
+ && (VECTOR_MODE_P (GET_MODE (new_rtx))
+ || COMPLEX_MODE_P (GET_MODE (new_rtx)))
+ && GET_MODE (tem) == GET_MODE_INNER (GET_MODE (new_rtx)))
+ return true;
+
/* The replacement we made so far is valid, if all of the recursive
replacements were valid, or we could simplify everything to
a constant. */