aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlan Lawrence <alan.lawrence@arm.com>2015-05-08 11:40:33 +0000
committerAlan Lawrence <alalaw01@gcc.gnu.org>2015-05-08 11:40:33 +0000
commit938fb83d2ce3c27a1b23c2a992bce3767179b73d (patch)
tree4ac193b0abb20f6a0ee9ea64d676a9fa569e887a /gcc
parent07ad804bfdbe0fa3406c5f2ff51d7c4c29a783c8 (diff)
downloadgcc-938fb83d2ce3c27a1b23c2a992bce3767179b73d.zip
gcc-938fb83d2ce3c27a1b23c2a992bce3767179b73d.tar.gz
gcc-938fb83d2ce3c27a1b23c2a992bce3767179b73d.tar.bz2
optabs.c: Make vector_compare_rtx cope with VOID mode constants (e.g. const0_rtx)
* optabs.c (vector_compare_rtx): Handle RTL operands having VOIDmode. From-SVN: r222907
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/optabs.c16
2 files changed, 17 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fa1623f..1d3b0a9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2015-05-08 Alan Lawrence <alan.lawrence@arm.com>
+
+ * optabs.c (vector_compare_rtx): Handle RTL operands having VOIDmode.
+
2015-05-08 Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/glibc-stdint.h (OPTION_MUSL): Define.
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 983c8d9..fbf0e38 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -6544,18 +6544,28 @@ vector_compare_rtx (enum tree_code tcode, tree t_op0, tree t_op1,
{
struct expand_operand ops[2];
rtx rtx_op0, rtx_op1;
+ machine_mode m0, m1;
enum rtx_code rcode = get_rtx_code (tcode, unsignedp);
gcc_assert (TREE_CODE_CLASS (tcode) == tcc_comparison);
- /* Expand operands. */
+ /* Expand operands. For vector types with scalar modes, e.g. where int64x1_t
+ has mode DImode, this can produce a constant RTX of mode VOIDmode; in such
+ cases, use the original mode. */
rtx_op0 = expand_expr (t_op0, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op0)),
EXPAND_STACK_PARM);
+ m0 = GET_MODE (rtx_op0);
+ if (m0 == VOIDmode)
+ m0 = TYPE_MODE (TREE_TYPE (t_op0));
+
rtx_op1 = expand_expr (t_op1, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op1)),
EXPAND_STACK_PARM);
+ m1 = GET_MODE (rtx_op1);
+ if (m1 == VOIDmode)
+ m1 = TYPE_MODE (TREE_TYPE (t_op1));
- create_input_operand (&ops[0], rtx_op0, GET_MODE (rtx_op0));
- create_input_operand (&ops[1], rtx_op1, GET_MODE (rtx_op1));
+ create_input_operand (&ops[0], rtx_op0, m0);
+ create_input_operand (&ops[1], rtx_op1, m1);
if (!maybe_legitimize_operands (icode, 4, 2, ops))
gcc_unreachable ();
return gen_rtx_fmt_ee (rcode, VOIDmode, ops[0].value, ops[1].value);