This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] S/390: Fix PR target/26018


Hello,

this fixes PR target/26018, which was caused by s390_decompose_address
unconditionally accepting (minus (label_ref ...) (label_ref ...)) as
valid displacement.  See the PR trail for more details.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux,
committed to mainline and 4.1 branch.

Bye,
Ulrich


ChangeLog:

	PR target/26018
	* config/s390/s390.c (struct machine_function): New flag
	decomposed_literal_pool_addresses_ok_p.
	(s390_reorg): Set it before final stage of literal pool transforms.
	(s390_decompose_address): Only accept displacements of the form
	(minus (label_ref ...) (label_ref ...)) if that flag is set.

Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c	(revision 110212)
--- gcc/config/s390/s390.c	(working copy)
*************** struct machine_function GTY(())
*** 279,284 ****
--- 279,287 ----
    /* True if we may need to perform branch splitting.  */
    bool split_branches_pending_p;
  
+   /* True during final stage of literal pool processing.  */
+   bool decomposed_literal_pool_addresses_ok_p;
+ 
    /* Some local-dynamic TLS symbol name.  */
    const char *some_ld_name;
  
*************** s390_decompose_address (rtx addr, struct
*** 1705,1711 ****
          }
  
        /* Accept chunkified literal pool symbol references.  */
!       else if (GET_CODE (disp) == MINUS
                 && GET_CODE (XEXP (disp, 0)) == LABEL_REF
                 && GET_CODE (XEXP (disp, 1)) == LABEL_REF)
          {
--- 1708,1716 ----
          }
  
        /* Accept chunkified literal pool symbol references.  */
!       else if (cfun && cfun->machine
! 	       && cfun->machine->decomposed_literal_pool_addresses_ok_p
! 	       && GET_CODE (disp) == MINUS
                 && GET_CODE (XEXP (disp, 0)) == LABEL_REF
                 && GET_CODE (XEXP (disp, 1)) == LABEL_REF)
          {
*************** s390_reorg (void)
*** 8934,8939 ****
--- 8939,8946 ----
       machine_dependent_reorg might confuse insn length counts.  */
    split_all_insns_noflow ();
  
+   /* From here on decomposed literal pool addresses must be accepted.  */
+   cfun->machine->decomposed_literal_pool_addresses_ok_p = true;
  
    /* Install the main literal pool and the associated base
       register load insns.
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]