varasm: Propagate litpool decl alignment to generated RTX.
When pushing a value into the literal pool the resulting decl might get a higher alignment than the original expression depending on how a target defines CONSTANT_ALIGNMENT. Generating an RTX for the constant pool access we currently use the alignment from the original expression. Changed with the attached patch. This fixes a GCC 6 regression for S/390. For arrays of string constants as in the attached testcase encode_section_info is not able to figure out that the constant pool slot is already properly aligned since the mem_align field in the rtx is not set properly. gcc/ChangeLog: 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. gcc/testsuite/ChangeLog: 2016-12-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * gcc.target/s390/litpool-str-1.c: New test. From-SVN: r243888
Showing
Please
register
or
sign in
to comment