always define HAVE_lo_sum
authortbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 24 May 2015 00:32:31 +0000 (00:32 +0000)
committertbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 24 May 2015 00:32:31 +0000 (00:32 +0000)
gcc/ChangeLog:

2015-05-23  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* combine.c (find_split_point): Check the value of HAVE_lo_sum
instead of if it is defined.
(combine_simplify_rtx): Likewise.
* lra-constraints.c (process_address_1): Likewise.
* config/darwin.c: Adjust.
* genconfig.c (main): Always define HAVE_lo_sum.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223619 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/combine.c
gcc/config/darwin.c
gcc/genconfig.c
gcc/lra-constraints.c

index 3ce1628..360f013 100644 (file)
@@ -1,3 +1,12 @@
+2015-05-23  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+       * combine.c (find_split_point): Check the value of HAVE_lo_sum
+       instead of if it is defined.
+       (combine_simplify_rtx): Likewise.
+       * lra-constraints.c (process_address_1): Likewise.
+       * config/darwin.c: Adjust.
+       * genconfig.c (main): Always define HAVE_lo_sum.
+
 2015-05-23  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
 
        * genmatch.c (parser::parse_operation): Reject expanding operator-list inside 'for'.
index 0817af2..73d141e 100644 (file)
@@ -4785,11 +4785,10 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src)
       return find_split_point (&SUBREG_REG (x), insn, false);
 
     case MEM:
-#ifdef HAVE_lo_sum
       /* If we have (mem (const ..)) or (mem (symbol_ref ...)), split it
         using LO_SUM and HIGH.  */
-      if (GET_CODE (XEXP (x, 0)) == CONST
-         || GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+      if (HAVE_lo_sum && (GET_CODE (XEXP (x, 0)) == CONST
+                         || GET_CODE (XEXP (x, 0)) == SYMBOL_REF))
        {
          machine_mode address_mode = get_address_mode (x);
 
@@ -4799,7 +4798,6 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src)
                                 XEXP (x, 0)));
          return &XEXP (XEXP (x, 0), 0);
        }
-#endif
 
       /* If we have a PLUS whose second operand is a constant and the
         address is not valid, perhaps will can split it up using
@@ -5857,16 +5855,14 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in_dest,
        SUBST (XEXP (x, 0), XEXP (XEXP (x, 0), 0));
       break;
 
-#ifdef HAVE_lo_sum
     case LO_SUM:
       /* Convert (lo_sum (high FOO) FOO) to FOO.  This is necessary so we
         can add in an offset.  find_split_point will split this address up
         again if it doesn't match.  */
-      if (GET_CODE (XEXP (x, 0)) == HIGH
+      if (HAVE_lo_sum && GET_CODE (XEXP (x, 0)) == HIGH
          && rtx_equal_p (XEXP (XEXP (x, 0), 0), XEXP (x, 1)))
        return XEXP (x, 1);
       break;
-#endif
 
     case PLUS:
       /* (plus (xor (and <foo> (const_int pow2 - 1)) <c>) <-c>)
index 5ea7088..ea7eec1 100644 (file)
@@ -149,8 +149,7 @@ int generating_for_darwin_version ;
 section * darwin_sections[NUM_DARWIN_SECTIONS];
 
 /* While we transition to using in-tests instead of ifdef'd code.  */
-#ifndef HAVE_lo_sum
-#define HAVE_lo_sum 0
+#if !HAVE_lo_sum
 #define gen_macho_high(a,b) (a)
 #define gen_macho_low(a,b,c) (a)
 #endif
index 7237ded..a0a834a 100644 (file)
@@ -360,6 +360,8 @@ main (int argc, char **argv)
 
   if (have_lo_sum_flag)
     printf ("#define HAVE_lo_sum 1\n");
+  else
+    printf ("#define HAVE_lo_sum 0\n");
 
   if (have_rotate_flag)
     printf ("#define HAVE_rotate 1\n");
index c0f2995..a8d0820 100644 (file)
@@ -2962,42 +2962,42 @@ process_address_1 (int nop, bool check_only_p,
          rtx addr = *ad.inner;
 
          new_reg = lra_create_new_reg (Pmode, NULL_RTX, cl, "addr");
-#ifdef HAVE_lo_sum
-         {
-           rtx_insn *insn;
-           rtx_insn *last = get_last_insn ();
-
-           /* addr => lo_sum (new_base, addr), case (2) above.  */
-           insn = emit_insn (gen_rtx_SET
-                             (new_reg,
-                              gen_rtx_HIGH (Pmode, copy_rtx (addr))));
-           code = recog_memoized (insn);
-           if (code >= 0)
-             {
-               *ad.inner = gen_rtx_LO_SUM (Pmode, new_reg, addr);
-               if (! valid_address_p (ad.mode, *ad.outer, ad.as))
-                 {
-                   /* Try to put lo_sum into register.  */
-                   insn = emit_insn (gen_rtx_SET
-                                     (new_reg,
-                                      gen_rtx_LO_SUM (Pmode, new_reg, addr)));
-                   code = recog_memoized (insn);
-                   if (code >= 0)
-                     {
-                       *ad.inner = new_reg;
-                       if (! valid_address_p (ad.mode, *ad.outer, ad.as))
-                         {
-                           *ad.inner = addr;
-                           code = -1;
-                         }
-                     }
-                   
-                 }
-             }
-           if (code < 0)
-             delete_insns_since (last);
-         }
-#endif
+         if (HAVE_lo_sum)
+           {
+             rtx_insn *insn;
+             rtx_insn *last = get_last_insn ();
+
+             /* addr => lo_sum (new_base, addr), case (2) above.  */
+             insn = emit_insn (gen_rtx_SET
+                               (new_reg,
+                                gen_rtx_HIGH (Pmode, copy_rtx (addr))));
+             code = recog_memoized (insn);
+             if (code >= 0)
+               {
+                 *ad.inner = gen_rtx_LO_SUM (Pmode, new_reg, addr);
+                 if (! valid_address_p (ad.mode, *ad.outer, ad.as))
+                   {
+                     /* Try to put lo_sum into register.  */
+                     insn = emit_insn (gen_rtx_SET
+                                       (new_reg,
+                                        gen_rtx_LO_SUM (Pmode, new_reg, addr)));
+                     code = recog_memoized (insn);
+                     if (code >= 0)
+                       {
+                         *ad.inner = new_reg;
+                         if (! valid_address_p (ad.mode, *ad.outer, ad.as))
+                           {
+                             *ad.inner = addr;
+                             code = -1;
+                           }
+                       }
+
+                   }
+               }
+             if (code < 0)
+               delete_insns_since (last);
+           }
+
          if (code < 0)
            {
              /* addr => new_base, case (2) above.  */