The boundary argument of the vec_load_bndry builtin needs to be
rewritten. At that point it must be constant already. The current
diagnostics in s390_expand_builtins is too late for this. The patch
adds an additional check for that builtin which will be triggered
already during preprocessing.
Regression tested on s390x.
gcc/testsuite/ChangeLog:
2017-03-24 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/79893
* gcc.target/s390/zvector/pr79893.c: New test.
gcc/ChangeLog:
2017-03-24 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/79893
* config/s390/s390-c.c (s390_adjust_builtin_arglist): Issue an
error if the boundary argument is not constant.
From-SVN: r246442
+2017-03-24 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ PR target/79893
+ * config/s390/s390-c.c (s390_adjust_builtin_arglist): Issue an
+ error if the boundary argument is not constant.
+
2017-03-24 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/80112
case S390_OVERLOADED_BUILTIN_s390_vec_load_bndry:
{
int code;
-
if (dest_arg_index == 1)
{
- switch (tree_to_uhwi ((**arglist)[src_arg_index]))
+ tree arg = (**arglist)[src_arg_index];
+
+ if (TREE_CODE (arg) != INTEGER_CST)
+ {
+ error ("constant value required for builtin %qF argument %d",
+ decl, src_arg_index + 1);
+ return;
+ }
+
+ switch (tree_to_uhwi (arg))
{
case 64: code = 0; break;
case 128: code = 1; break;
+2017-03-24 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ PR target/79893
+ * gcc.target/s390/zvector/pr79893.c: New test.
+
2017-03-24 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/80112
--- /dev/null
+/* { dg-do compile { target { s390*-*-* } } } */
+/* { dg-options "-march=z13 -mzarch -mzvector" } */
+
+#include <vecintrin.h>
+
+void
+foo(signed char *p, int i) {
+ vec_load_bndry(p, i); /* { dg-error "constant value required for builtin.*2" } */
+}