This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
S/390: Fix literal pool handling regression
- From: Ulrich Weigand <weigand at immd1 dot informatik dot uni-erlangen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Mar 2003 21:34:09 +0100 (MET)
- Subject: S/390: Fix literal pool handling regression
Hello,
this fixes a regression in literal pool handling introduced
some time ago. We need to emit the pool start label even if
the pool is empty for -fPIC code, because that label can be
used as anchor for position independent address calculations.
While it is rare that this happens, it can occur in some cases
of literal pool overflow.
Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux
on 3.3 and CVS head; applied to both.
ChangeLog:
* config/s390/s390.md ("literal_pool_31"): Output pool anchor
label even if pool empty when generating PIC.
("literal_pool_31", "literal_pool_64"): Coding style cleanup.
Index: gcc/config/s390/s390.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v
retrieving revision 1.52
diff -c -p -r1.52 s390.md
*** gcc/config/s390/s390.md 22 Mar 2003 17:52:07 -0000 1.52
--- gcc/config/s390/s390.md 28 Mar 2003 18:16:40 -0000
***************
*** 7031,7044 ****
(label_ref (match_operand 1 "" "")))
(use (label_ref (match_operand 2 "" "")))]
""
- "*
{
! if (s390_nr_constants) {
! output_asm_insn (\"bras\\t%0,%2\", operands);
! s390_output_constant_pool (operands[1], operands[2]);
! }
! return \"\";
! }"
[(set_attr "op_type" "NN")
(set_attr "type" "larl")])
--- 7031,7051 ----
(label_ref (match_operand 1 "" "")))
(use (label_ref (match_operand 2 "" "")))]
""
{
! if (s390_nr_constants)
! {
! output_asm_insn ("bras\\t%0,%2", operands);
! s390_output_constant_pool (operands[1], operands[2]);
! }
! else if (flag_pic)
! {
! /* We need the anchor label in any case. */
! (*targetm.asm_out.internal_label) (asm_out_file, "L",
! CODE_LABEL_NUMBER (operands[1]));
! }
!
! return "";
! }
[(set_attr "op_type" "NN")
(set_attr "type" "larl")])
***************
*** 7048,7060 ****
(label_ref (match_operand 1 "" "")))
(use (label_ref (match_operand 2 "" "")))]
""
- "*
{
! if (s390_nr_constants) {
! output_asm_insn (\"larl\\t%0,%1\", operands);
! s390_output_constant_pool (operands[1], operands[2]);
! }
! return \"\";
! }"
[(set_attr "op_type" "NN")
(set_attr "type" "larl")])
--- 7055,7068 ----
(label_ref (match_operand 1 "" "")))
(use (label_ref (match_operand 2 "" "")))]
""
{
! if (s390_nr_constants)
! {
! output_asm_insn ("larl\\t%0,%1", operands);
! s390_output_constant_pool (operands[1], operands[2]);
! }
!
! return "";
! }
[(set_attr "op_type" "NN")
(set_attr "type" "larl")])
--
Dr. Ulrich Weigand
weigand at informatik dot uni-erlangen dot de