+2016-12-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ * varasm.c (build_constant_desc): Use the alignment of the var
+ decl instead of the original expression.
+
2016-12-22 Dominik Vogt <vogt@linux.vnet.ibm.com>
* config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Define
+2016-12-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ * gcc.target/s390/litpool-str-1.c: New test.
+
2016-12-22 Dominik Vogt <vogt@linux.vnet.ibm.com>
* gcc.target/s390/md/setmem_long-1.c: Use "s390_useable_hw".
--- /dev/null
+/* Make sure strings are recognized as being accessible through larl.
+ This requires the symbol ref alignment properly propagated to
+ encode_section_info. */
+
+/* { dg-do compile } */
+/* { dg-options "-march=z900 -O2 -fpic" } */
+
+
+extern void foo(const char*, const char*, const char*);
+
+void bar(int i)
+{
+ const char t1[10] = "test";
+ const char t2[10] = "test2";
+ const char t3[2][10] = {
+ "foofoofoo",
+ "barbarbar",
+ };
+ foo(t1, t2, t3[i]);
+}
+
+/* { dg-final { scan-assembler-not "GOTOFF" } } */
set_mem_attributes (rtl, exp, 1);
set_mem_alias_set (rtl, 0);
+ /* Putting EXP into the literal pool might have imposed a different
+ alignment which should be visible in the RTX as well. */
+ set_mem_align (rtl, DECL_ALIGN (decl));
+
/* We cannot share RTX'es in pool entries.
Mark this piece of RTL as required for unsharing. */
RTX_FLAG (rtl, used) = 1;