]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/54635 (Add addr_space_t argument to TARGET_MODE_DEPENDENT_ADDRESS_P)
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 26 Sep 2012 13:46:29 +0000 (13:46 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Wed, 26 Sep 2012 13:46:29 +0000 (13:46 +0000)
PR middle-end/54635
* doc/tm.texi.in (TARGET_MODE_DEPENDENT_ADDRESS_P): Document new
parameter addrspace.
* doc/tm.texi: Regenerate.
* target.def (mode_dependent_address_p): Add addr_space_t parameter.
* targhooks.h (default_mode_dependent_address_p): Ditto.
* targhooks.c (default_mode_dependent_address_p): Ditto.
* expr.c (convert_move): Pass address space to mode_dependent_address_p.
* combine.c (combine_simplify_rtx): Ditto.
(make_extraction): Ditto.
(simplify_shift_const_1): Ditto.
(gen_lowpart_for_combine): Ditto.
* lower-subreg.c (simple_move_operand): Ditto.
* recog.c (simplify_while_replacing): Ditto.
(offsettable_address_addr_space_p): Ditto.
(mode_dependent_address_p): Ditto.
* simplify-rtx.c (simplify_unary_operation_1): Ditto.
(simplify_subreg): Ditto.
* config/m68k/m68k.md: Ditto.
* config/vax/vax.md: Ditto.
* config/vax/constraints.md (Q): Ditto.
* config/vax/predicates.md (indexed_memory_operand): Ditto.
* config/alpha/alpha.c (alpha_mode_dependent_address_p): Add
unused addr_space_t parameter.
* config/avr/avr.c (avr_mode_dependent_address_p): Ditto.
* config/h8300/h8300.c (h8300_mode_dependent_address_p): Ditto.
* config/m32r/m32r.c (m32r_mode_dependent_address_p): Ditto.
* config/rs6000/rs6000.c (rs6000_mode_dependent_address_p): Ditto.
* config/rx/rx.c (rx_mode_dependent_address_p): Ditto.
* config/sparc/sparc.c (sparc_mode_dependent_address_p): Ditto.
* config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p):
Ditto.
* config/vax/vax.c (vax_mode_dependent_address_p): Ditto.
* config/xtensa/xtensa.c (xtensa_mode_dependent_address_p): Ditto.

From-SVN: r191761

27 files changed:
gcc/ChangeLog
gcc/combine.c
gcc/config/alpha/alpha.c
gcc/config/avr/avr.c
gcc/config/avr/avr.md
gcc/config/h8300/h8300.c
gcc/config/m32r/m32r.c
gcc/config/m68k/m68k.md
gcc/config/rs6000/rs6000.c
gcc/config/rx/rx.c
gcc/config/sparc/sparc.c
gcc/config/stormy16/stormy16.c
gcc/config/vax/constraints.md
gcc/config/vax/predicates.md
gcc/config/vax/vax.c
gcc/config/vax/vax.md
gcc/config/xtensa/xtensa.c
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/expr.c
gcc/lower-subreg.c
gcc/recog.c
gcc/recog.h
gcc/simplify-rtx.c
gcc/target.def
gcc/targhooks.c
gcc/targhooks.h

index ce08fce096c151ed2d971a5d61ad76799b546262..c2c072db98558916c91bc8e2392cc9cf1949ea5b 100644 (file)
@@ -1,3 +1,40 @@
+2012-09-26  Georg-Johann Lay  <avr@gjlay.de>
+
+       PR middle-end/54635
+       * doc/tm.texi.in (TARGET_MODE_DEPENDENT_ADDRESS_P): Document new
+       parameter addrspace.
+       * doc/tm.texi: Regenerate.
+       * target.def (mode_dependent_address_p): Add addr_space_t parameter.
+       * targhooks.h (default_mode_dependent_address_p): Ditto.
+       * targhooks.c (default_mode_dependent_address_p): Ditto.
+       * expr.c (convert_move): Pass address space to mode_dependent_address_p.
+       * combine.c (combine_simplify_rtx): Ditto.
+       (make_extraction): Ditto.
+       (simplify_shift_const_1): Ditto.
+       (gen_lowpart_for_combine): Ditto.
+       * lower-subreg.c (simple_move_operand): Ditto.
+       * recog.c (simplify_while_replacing): Ditto.
+       (offsettable_address_addr_space_p): Ditto.
+       (mode_dependent_address_p): Ditto.
+       * simplify-rtx.c (simplify_unary_operation_1): Ditto.
+       (simplify_subreg): Ditto.
+       * config/m68k/m68k.md: Ditto.
+       * config/vax/vax.md: Ditto.
+       * config/vax/constraints.md (Q): Ditto.
+       * config/vax/predicates.md (indexed_memory_operand): Ditto.
+       * config/alpha/alpha.c (alpha_mode_dependent_address_p): Add
+       unused addr_space_t parameter.
+       * config/avr/avr.c (avr_mode_dependent_address_p): Ditto.
+       * config/h8300/h8300.c (h8300_mode_dependent_address_p): Ditto.
+       * config/m32r/m32r.c (m32r_mode_dependent_address_p): Ditto.
+       * config/rs6000/rs6000.c (rs6000_mode_dependent_address_p): Ditto.
+       * config/rx/rx.c (rx_mode_dependent_address_p): Ditto.
+       * config/sparc/sparc.c (sparc_mode_dependent_address_p): Ditto.
+       * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p):
+       Ditto.
+       * config/vax/vax.c (vax_mode_dependent_address_p): Ditto.
+       * config/xtensa/xtensa.c (xtensa_mode_dependent_address_p): Ditto.
+
 2012-09-26  Christophe Lyon <christophe.lyon@linaro.org>
 
        * tree-ssa-math-opts.c (bswap_stats): Add found_16bit field.
index ad86f68d26dd0f609fee1b0777ac03dab9e4605e..4e0a57963dc4b6f6e0b34da1aa4c4ba56af5a3c0 100644 (file)
@@ -5424,7 +5424,8 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest,
         of the address.  */
       if (MEM_P (SUBREG_REG (x))
          && (MEM_VOLATILE_P (SUBREG_REG (x))
-             || mode_dependent_address_p (XEXP (SUBREG_REG (x), 0))))
+             || mode_dependent_address_p (XEXP (SUBREG_REG (x), 0),
+                                          MEM_ADDR_SPACE (SUBREG_REG (x)))))
        return gen_rtx_CLOBBER (mode, const0_rtx);
 
       /* Note that we cannot do any narrowing for non-constants since
@@ -7054,7 +7055,8 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
                 may not be aligned, for one thing).  */
              && GET_MODE_PRECISION (inner_mode) >= GET_MODE_PRECISION (tmode)
              && (inner_mode == tmode
-                 || (! mode_dependent_address_p (XEXP (inner, 0))
+                 || (! mode_dependent_address_p (XEXP (inner, 0),
+                                                 MEM_ADDR_SPACE (inner))
                      && ! MEM_VOLATILE_P (inner))))))
     {
       /* If INNER is a MEM, make a new MEM that encompasses just the desired
@@ -7233,7 +7235,7 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
       /* If we have to change the mode of memory and cannot, the desired mode
         is EXTRACTION_MODE.  */
       if (inner_mode != wanted_inner_mode
-         && (mode_dependent_address_p (XEXP (inner, 0))
+         && (mode_dependent_address_p (XEXP (inner, 0), MEM_ADDR_SPACE (inner))
              || MEM_VOLATILE_P (inner)
              || pos_rtx))
        wanted_inner_mode = extraction_mode;
@@ -7271,7 +7273,7 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
       && ! pos_rtx
       && GET_MODE_SIZE (wanted_inner_mode) < GET_MODE_SIZE (is_mode)
       && MEM_P (inner)
-      && ! mode_dependent_address_p (XEXP (inner, 0))
+      && ! mode_dependent_address_p (XEXP (inner, 0), MEM_ADDR_SPACE (inner))
       && ! MEM_VOLATILE_P (inner))
     {
       int offset = 0;
@@ -9883,7 +9885,8 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode,
             minus the width of a smaller mode, we can do this with a
             SIGN_EXTEND or ZERO_EXTEND from the narrower memory location.  */
          if ((code == ASHIFTRT || code == LSHIFTRT)
-             && ! mode_dependent_address_p (XEXP (varop, 0))
+             && ! mode_dependent_address_p (XEXP (varop, 0),
+                                            MEM_ADDR_SPACE (varop))
              && ! MEM_VOLATILE_P (varop)
              && (tmode = mode_for_size (GET_MODE_BITSIZE (mode) - count,
                                         MODE_INT, 1)) != BLKmode)
@@ -10702,7 +10705,8 @@ gen_lowpart_for_combine (enum machine_mode omode, rtx x)
 
       /* Refuse to work on a volatile memory ref or one with a mode-dependent
         address.  */
-      if (MEM_VOLATILE_P (x) || mode_dependent_address_p (XEXP (x, 0)))
+      if (MEM_VOLATILE_P (x)
+         || mode_dependent_address_p (XEXP (x, 0), MEM_ADDR_SPACE (x)))
        goto fail;
 
       /* If we want to refer to something bigger than the original memref,
index 9aaa4f2bd2fd6290ee9a3e9cee1eee0e5a93c359..d726b5acca79236686fef85b642fccc17abffb7a 100644 (file)
@@ -1043,7 +1043,8 @@ alpha_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
    We can simplify the test since we know that the address must be valid.  */
 
 static bool
-alpha_mode_dependent_address_p (const_rtx addr)
+alpha_mode_dependent_address_p (const_rtx addr,
+                               addr_space_t as ATTRIBUTE_UNUSED)
 {
   return GET_CODE (addr) == AND;
 }
index f23a7e80283173a82aa9e9d8acea42500d0cbfa9..87ff5312300684e81b7437bf226c57b5371331f1 100644 (file)
@@ -1633,7 +1633,7 @@ avr_cannot_modify_jumps_p (void)
       with mov<mode> expanders in avr.md.  */
 
 static bool
-avr_mode_dependent_address_p (const_rtx addr)
+avr_mode_dependent_address_p (const_rtx addr, addr_space_t as ATTRIBUTE_UNUSED)
 {
   return GET_MODE (addr) != Pmode;
 }
index d1287703e14a89043707cfc8eb2f64d72d918f37..b86f9b639df49253837a44a6ffa11bcead5abb90 100644 (file)
 ;; "*addhq3" "*adduhq3"
 ;; "*addha3" "*adduha3"
 (define_insn "*add<mode>3"
-  [(set (match_operand:ALL2 0 "register_operand"                     "=r,d,!w    ,d")
+  [(set (match_operand:ALL2 0 "register_operand"                    "=?r,d,!w    ,d")
         (plus:ALL2 (match_operand:ALL2 1 "register_operand"          "%0,0,0     ,0")
                    (match_operand:ALL2 2 "nonmemory_or_const_operand" "r,s,IJ YIJ,n Ynn")))]
   ""
index 3dd071a63c4d7e6eb311f194375248348532aa1e..38a922898e2aa23f628d463d19af044a314821ef 100644 (file)
@@ -2166,7 +2166,8 @@ h8300_get_index (rtx x, enum machine_mode mode, int *size)
    (the amount of decrement or increment being the length of the operand).  */
 
 static bool
-h8300_mode_dependent_address_p (const_rtx addr)
+h8300_mode_dependent_address_p (const_rtx addr,
+                               addr_space_t as ATTRIBUTE_UNUSED)
 {
   if (GET_CODE (addr) == PLUS
       && h8300_get_index (XEXP (addr, 0), VOIDmode, 0) != XEXP (addr, 0))
index 4d899666f2bed18c514b5dc6db385124f57dd9f3..03360b6a5b02892d1a4ccb82a07f6c92aa42102f 100644 (file)
@@ -62,7 +62,7 @@ static void  block_move_call (rtx, rtx, rtx);
 static int   m32r_is_insn (rtx);
 static bool  m32r_legitimate_address_p (enum machine_mode, rtx, bool);
 static rtx   m32r_legitimize_address (rtx, rtx, enum machine_mode);
-static bool  m32r_mode_dependent_address_p (const_rtx);
+static bool  m32r_mode_dependent_address_p (const_rtx, addr_space_t);
 static tree  m32r_handle_model_attribute (tree *, tree, tree, int, bool *);
 static void  m32r_print_operand (FILE *, rtx, int);
 static void  m32r_print_operand_address (FILE *, rtx);
@@ -2011,7 +2011,7 @@ m32r_legitimize_address (rtx x, rtx orig_x ATTRIBUTE_UNUSED,
 /* Worker function for TARGET_MODE_DEPENDENT_ADDRESS_P.  */
 
 static bool
-m32r_mode_dependent_address_p (const_rtx addr)
+m32r_mode_dependent_address_p (const_rtx addr, addr_space_t as ATTRIBUTE_UNUSED)
 {
   if (GET_CODE (addr) == LO_SUM)
     return true;
index 00a69c78d88402ee6942455fd32c3edd4e404c11..82807d8da6ff8b4d4d122190c07fe9fd802fd8eb 100644 (file)
        (match_operand:SI 2 "general_src_operand" "rmSi"))]
   "TARGET_68020 && TARGET_BITFIELD
    && (INTVAL (operands[1]) % 8) == 0
-   && ! mode_dependent_address_p (XEXP (operands[0], 0))"
+   && ! mode_dependent_address_p (XEXP (operands[0], 0),
+                                  MEM_ADDR_SPACE (operands[0]))"
 {
   operands[0]
     = adjust_address (operands[0], SImode, INTVAL (operands[1]) / 8);
    && (INTVAL (operands[1]) == 8 || INTVAL (operands[1]) == 16)
    && INTVAL (operands[2]) % INTVAL (operands[1]) == 0
    && (GET_CODE (operands[0]) == REG
-       || ! mode_dependent_address_p (XEXP (operands[0], 0)))"
+       || ! mode_dependent_address_p (XEXP (operands[0], 0),
+                                      MEM_ADDR_SPACE (operands[0])))"
 {
   if (REG_P (operands[0]))
     {
                         (match_operand:SI 2 "const_int_operand" "n")))]
   "TARGET_68020 && TARGET_BITFIELD
    && (INTVAL (operands[2]) % 8) == 0
-   && ! mode_dependent_address_p (XEXP (operands[1], 0))"
+   && ! mode_dependent_address_p (XEXP (operands[1], 0),
+                                  MEM_ADDR_SPACE (operands[1]))"
 {
   operands[1]
     = adjust_address (operands[1], SImode, INTVAL (operands[2]) / 8);
    && (INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
    && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
    && (GET_CODE (operands[1]) == REG
-       || ! mode_dependent_address_p (XEXP (operands[1], 0)))"
+       || ! mode_dependent_address_p (XEXP (operands[1], 0),
+                                      MEM_ADDR_SPACE (operands[1])))"
 {
   cc_status.flags |= CC_NOT_NEGATIVE;
   if (REG_P (operands[1]))
                         (match_operand:SI 2 "const_int_operand" "n")))]
   "TARGET_68020 && TARGET_BITFIELD
    && (INTVAL (operands[2]) % 8) == 0
-   && ! mode_dependent_address_p (XEXP (operands[1], 0))"
+   && ! mode_dependent_address_p (XEXP (operands[1], 0),
+                                  MEM_ADDR_SPACE (operands[1]))"
 {
   operands[1]
     = adjust_address (operands[1], SImode, INTVAL (operands[2]) / 8);
    && (INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
    && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
    && (GET_CODE (operands[1]) == REG
-       || ! mode_dependent_address_p (XEXP (operands[1], 0)))"
+       || ! mode_dependent_address_p (XEXP (operands[1], 0),
+                                      MEM_ADDR_SPACE (operands[1])))"
 {
   if (REG_P (operands[1]))
     {
index 211087ba37eeba1bc8fdb8a2c8e325ae0ffac632..96026bdc50515b17f1bc1789b4c5e28ad673d80b 100644 (file)
@@ -6463,7 +6463,8 @@ rs6000_debug_legitimate_address_p (enum machine_mode mode, rtx x,
 /* Implement TARGET_MODE_DEPENDENT_ADDRESS_P.  */
 
 static bool
-rs6000_mode_dependent_address_p (const_rtx addr)
+rs6000_mode_dependent_address_p (const_rtx addr,
+                                addr_space_t as ATTRIBUTE_UNUSED)
 {
   return rs6000_mode_dependent_address_ptr (addr);
 }
index 472625e4af6ddb50980633ee5e584058a4c028f1..43676d1251cd1d2175586dfc57c98262a22752e5 100644 (file)
@@ -318,7 +318,7 @@ rx_is_restricted_memory_address (rtx mem, enum machine_mode mode)
 /* Implement TARGET_MODE_DEPENDENT_ADDRESS_P.  */
 
 static bool
-rx_mode_dependent_address_p (const_rtx addr)
+rx_mode_dependent_address_p (const_rtx addr, addr_space_t as ATTRIBUTE_UNUSED)
 {
   if (GET_CODE (addr) == CONST)
     addr = XEXP (addr, 0);
index fa36901f9e04f9b222b19afc80f5479c564f71e7..32ac9f3b5b66f859d427f508efccc19c00b8ce3e 100644 (file)
@@ -567,7 +567,7 @@ static rtx sparc_legitimize_tls_address (rtx);
 static rtx sparc_legitimize_pic_address (rtx, rtx);
 static rtx sparc_legitimize_address (rtx, rtx, enum machine_mode);
 static rtx sparc_delegitimize_address (rtx);
-static bool sparc_mode_dependent_address_p (const_rtx);
+static bool sparc_mode_dependent_address_p (const_rtx, addr_space_t);
 static bool sparc_pass_by_reference (cumulative_args_t,
                                     enum machine_mode, const_tree, bool);
 static void sparc_function_arg_advance (cumulative_args_t,
@@ -4045,7 +4045,8 @@ sparc_legitimize_reload_address (rtx x, enum machine_mode mode,
 
 
 static bool
-sparc_mode_dependent_address_p (const_rtx addr)
+sparc_mode_dependent_address_p (const_rtx addr,
+                               addr_space_t as ATTRIBUTE_UNUSED)
 {
   if (flag_pic && GET_CODE (addr) == PLUS)
     {
index a6f2b5447b7e4036c768003aaf033dfd3cf1eb94..782217c9bb8d86bfdf9a4ef08ec515b465f3df57 100644 (file)
@@ -671,7 +671,8 @@ xstormy16_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
    or pre-decrement address.  */
 
 static bool
-xstormy16_mode_dependent_address_p (const_rtx x)
+xstormy16_mode_dependent_address_p (const_rtx x,
+                                   addr_space_t as ATTRIBUTE_UNUSED)
 {
   if (LEGITIMATE_ADDRESS_CONST_INT_P (x, 0)
       && ! LEGITIMATE_ADDRESS_CONST_INT_P (x, 6))
index e3266f676a5f472d4560df145ef447d3e1195f06..6c0256b455346e6c0700451ca277ad2ba2b3c686 100644 (file)
@@ -99,7 +99,8 @@
 (define_memory_constraint "Q"
    "operand is a MEM that does not have a mode-dependent address."
    (and (match_code "mem")
-       (match_test "!mode_dependent_address_p (XEXP (op, 0))")))
+       (match_test "!mode_dependent_address_p (XEXP (op, 0),
+                                               MEM_ADDR_SPACE (op))")))
 
 (define_memory_constraint "B"
     ""
index 775ddcddfe64a37d7dbf0ef346feca6394575287..b15c281386ff9a1580939530928ccf07d78747ed 100644 (file)
@@ -79,9 +79,9 @@
 (define_predicate "indexed_memory_operand"
    (match_code "mem")
 {
-  op = XEXP (op, 0);
-  return GET_CODE (op) != PRE_DEC && GET_CODE (op) != POST_INC
-        && mode_dependent_address_p (op);
+  rtx addr = XEXP (op, 0);
+  return GET_CODE (addr) != PRE_DEC && GET_CODE (addr) != POST_INC
+        && mode_dependent_address_p (addr, MEM_ADDR_SPACE (op));
 })
 
 (define_predicate "illegal_blk_memory_operand"
index 239b82c3895778e15ffce4217977ddbbf6bb18f2..e13ad8e7048fc404029a417d83850e0f1c57d3bc 100644 (file)
@@ -64,7 +64,7 @@ static rtx vax_builtin_setjmp_frame_value (void);
 static void vax_asm_trampoline_template (FILE *);
 static void vax_trampoline_init (rtx, tree, rtx);
 static int vax_return_pops_args (tree, tree, int);
-static bool vax_mode_dependent_address_p (const_rtx);
+static bool vax_mode_dependent_address_p (const_rtx, addr_space_t);
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -1839,7 +1839,7 @@ vax_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
    thus (because the index scale factor is the length of the operand).  */
 
 static bool
-vax_mode_dependent_address_p (const_rtx x)
+vax_mode_dependent_address_p (const_rtx x, addr_space_t as ATTRIBUTE_UNUSED)
 {
   rtx xfoo0, xfoo1;
 
index afc31293d6dcdaa614dddb39658afa5f6a8e0223..342c0e19dccfe8851d24dd8264b2f78a2574c1f7 100644 (file)
    "(INTVAL (operands[1]) == 8 || INTVAL (operands[1]) == 16)
    && INTVAL (operands[2]) % INTVAL (operands[1]) == 0
    && (REG_P (operands[0])
-       || ! mode_dependent_address_p (XEXP (operands[0], 0)))"
+       || ! mode_dependent_address_p (XEXP (operands[0], 0),
+                                      MEM_ADDR_SPACE (operands[0])))"
   "*
 {
   if (REG_P (operands[0]))
   "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
    && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
    && (REG_P (operands[1])
-       || ! mode_dependent_address_p (XEXP (operands[1], 0)))"
+       || ! mode_dependent_address_p (XEXP (operands[1], 0),
+                                     MEM_ADDR_SPACE (operands[1])))"
   "*
 {
   if (REG_P (operands[1]))
   "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
    && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
    && (REG_P (operands[1])
-       || ! mode_dependent_address_p (XEXP (operands[1], 0)))"
+       || ! mode_dependent_address_p (XEXP (operands[1], 0),
+                                     MEM_ADDR_SPACE (operands[1])))"
   "*
 {
   if (REG_P (operands[1]))
       || INTVAL (operands[2]) + INTVAL (operands[3]) > 32
       || side_effects_p (operands[1])
       || (MEM_P (operands[1])
-         && mode_dependent_address_p (XEXP (operands[1], 0))))
+         && mode_dependent_address_p (XEXP (operands[1], 0),
+                                      MEM_ADDR_SPACE (operands[1]))))
     return \"extv %3,%2,%1,%0\";
   if (INTVAL (operands[2]) == 8)
     return \"rotl %R3,%1,%0\;cvtbl %0,%0\";
       || INTVAL (operands[2]) + INTVAL (operands[3]) > 32
       || side_effects_p (operands[1])
       || (MEM_P (operands[1])
-         && mode_dependent_address_p (XEXP (operands[1], 0))))
+         && mode_dependent_address_p (XEXP (operands[1], 0),
+                                      MEM_ADDR_SPACE (operands[1]))))
     return \"extzv %3,%2,%1,%0\";
   if (INTVAL (operands[2]) == 8)
     return \"rotl %R3,%1,%0\;movzbl %0,%0\";
index 987b6d7020f25926017a8e31e485b616346f6732..83eab4b9e7a1ab85bcb86b1c650a678782d5eb17 100644 (file)
@@ -126,7 +126,7 @@ static rtx fixup_subreg_mem (rtx);
 static struct machine_function * xtensa_init_machine_status (void);
 static rtx xtensa_legitimize_tls_address (rtx);
 static rtx xtensa_legitimize_address (rtx, rtx, enum machine_mode);
-static bool xtensa_mode_dependent_address_p (const_rtx);
+static bool xtensa_mode_dependent_address_p (const_rtx, addr_space_t);
 static bool xtensa_return_in_msb (const_tree);
 static void printx (FILE *, signed int);
 static void xtensa_function_epilogue (FILE *, HOST_WIDE_INT);
@@ -1961,7 +1961,8 @@ xtensa_legitimize_address (rtx x,
    by default.  */
 
 static bool
-xtensa_mode_dependent_address_p (const_rtx addr)
+xtensa_mode_dependent_address_p (const_rtx addr,
+                                addr_space_t as ATTRIBUTE_UNUSED)
 {
   return constantpool_address_p (addr);
 }
index d268fd8e3b677308a822546646199e83b2459ed7..a14a4fc9a8859726bf0a974b04284b6a7949abc9 100644 (file)
@@ -5611,8 +5611,9 @@ It is not necessary for this macro to come up with a legitimate
 address;  but often a machine-dependent strategy can generate better code.
 @end defmac
 
-@deftypefn {Target Hook} bool TARGET_MODE_DEPENDENT_ADDRESS_P (const_rtx @var{addr})
-This hook returns @code{true} if memory address @var{addr} can have
+@deftypefn {Target Hook} bool TARGET_MODE_DEPENDENT_ADDRESS_P (const_rtx @var{addr}, addr_space_t @var{addrspace})
+This hook returns @code{true} if memory address @var{addr} in address
+space @var{addrspace} can have
 different meanings depending on the machine mode of the memory
 reference it is used for or if the address is valid for some modes
 but not others.
index 86c7f5d218c68679fe2f39f02e5af5ad59538653..a85fee1b4a140d98ad80a0356464ed6f61a5404e 100644 (file)
@@ -5536,7 +5536,8 @@ address;  but often a machine-dependent strategy can generate better code.
 @end defmac
 
 @hook TARGET_MODE_DEPENDENT_ADDRESS_P
-This hook returns @code{true} if memory address @var{addr} can have
+This hook returns @code{true} if memory address @var{addr} in address
+space @var{addrspace} can have
 different meanings depending on the machine mode of the memory
 reference it is used for or if the address is valid for some modes
 but not others.
index 9158b9f43955fe24ee94f4dfcb8cd82e2986a28e..c180e8d5edcbc3c66e38875406698b955867db3b 100644 (file)
@@ -573,7 +573,8 @@ convert_move (rtx to, rtx from, int unsignedp)
       if (!((MEM_P (from)
             && ! MEM_VOLATILE_P (from)
             && direct_load[(int) to_mode]
-            && ! mode_dependent_address_p (XEXP (from, 0)))
+            && ! mode_dependent_address_p (XEXP (from, 0),
+                                           MEM_ADDR_SPACE (from)))
            || REG_P (from)
            || GET_CODE (from) == SUBREG))
        from = force_reg (from_mode, from);
@@ -591,7 +592,8 @@ convert_move (rtx to, rtx from, int unsignedp)
       if (!((MEM_P (from)
             && ! MEM_VOLATILE_P (from)
             && direct_load[(int) to_mode]
-            && ! mode_dependent_address_p (XEXP (from, 0)))
+            && ! mode_dependent_address_p (XEXP (from, 0),
+                                           MEM_ADDR_SPACE (from)))
            || REG_P (from)
            || GET_CODE (from) == SUBREG))
        from = force_reg (from_mode, from);
index dfc3954e768f4d2b6a641e6b5d91fbd163a7bf0b..4aaaa7754c5ca91858be2a7b594625693e5ed3b2 100644 (file)
@@ -299,7 +299,7 @@ simple_move_operand (rtx x)
 
   if (MEM_P (x)
       && (MEM_VOLATILE_P (x)
-         || mode_dependent_address_p (XEXP (x, 0))))
+         || mode_dependent_address_p (XEXP (x, 0), MEM_ADDR_SPACE (x))))
     return false;
 
   return true;
index 5058da2e11e89555849b7065b22ffc7943b8071f..f28b0219d95db8f03b07c2bed95cb85437692866 100644 (file)
@@ -629,7 +629,8 @@ simplify_while_replacing (rtx *loc, rtx to, rtx object,
       if (MEM_P (XEXP (x, 0))
          && CONST_INT_P (XEXP (x, 1))
          && CONST_INT_P (XEXP (x, 2))
-         && !mode_dependent_address_p (XEXP (XEXP (x, 0), 0))
+         && !mode_dependent_address_p (XEXP (XEXP (x, 0), 0),
+                                       MEM_ADDR_SPACE (XEXP (x, 0)))
          && !MEM_VOLATILE_P (XEXP (x, 0)))
        {
          enum machine_mode wanted_mode = VOIDmode;
@@ -1945,7 +1946,7 @@ offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y,
   /* Adjusting an offsettable address involves changing to a narrower mode.
      Make sure that's OK.  */
 
-  if (mode_dependent_address_p (y))
+  if (mode_dependent_address_p (y, as))
     return 0;
 
   /* ??? How much offset does an offsettable BLKmode reference need?
@@ -1998,11 +1999,13 @@ offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y,
 /* Return 1 if ADDR is an address-expression whose effect depends
    on the mode of the memory reference it is used in.
 
+   ADDRSPACE is the address space associated with the address.
+
    Autoincrement addressing is a typical example of mode-dependence
    because the amount of the increment depends on the mode.  */
 
 bool
-mode_dependent_address_p (rtx addr)
+mode_dependent_address_p (rtx addr, addr_space_t addrspace)
 {
   /* Auto-increment addressing with anything other than post_modify
      or pre_modify always introduces a mode dependency.  Catch such
@@ -2013,7 +2016,7 @@ mode_dependent_address_p (rtx addr)
       || GET_CODE (addr) == POST_DEC)
     return true;
 
-  return targetm.mode_dependent_address_p (addr);
+  return targetm.mode_dependent_address_p (addr, addrspace);
 }
 \f
 /* Like extract_insn, but save insn extracted and don't extract again, when
index 9fb3443254a696b935f93e9a460eb69bb18a28ba..0e7d5373aa3f94b38da75b2cf7c520e0890a4267 100644 (file)
@@ -114,7 +114,7 @@ extern int offsettable_address_addr_space_p (int, enum machine_mode, rtx,
 #define offsettable_address_p(strict,mode,addr) \
        offsettable_address_addr_space_p ((strict), (mode), (addr), \
                                          ADDR_SPACE_GENERIC)
-extern bool mode_dependent_address_p (rtx);
+extern bool mode_dependent_address_p (rtx, addr_space_t);
 
 extern int recog (rtx, rtx, int *);
 #ifndef GENERATOR_FILE
index 97a9330d156ac2b0e38be1dcbd6b7ab855fb494b..6b4b9f05d6550cd96e1413397ff6c6e5a2812508 100644 (file)
@@ -874,7 +874,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
         if we are not changing the meaning of the address. */
       if (GET_CODE (op) == MEM
          && !MEM_VOLATILE_P (op)
-         && !mode_dependent_address_p (XEXP (op, 0)))
+         && !mode_dependent_address_p (XEXP (op, 0), MEM_ADDR_SPACE (op)))
        return rtl_hooks.gen_lowpart_no_emit (mode, op);
 
       break;
@@ -5615,7 +5615,7 @@ simplify_subreg (enum machine_mode outermode, rtx op,
      or if we would be widening it.  */
 
   if (MEM_P (op)
-      && ! mode_dependent_address_p (XEXP (op, 0))
+      && ! mode_dependent_address_p (XEXP (op, 0), MEM_ADDR_SPACE (op))
       /* Allow splitting of volatile memory references in case we don't
          have instruction to move the whole thing.  */
       && (! MEM_VOLATILE_P (op)
@@ -5773,7 +5773,8 @@ simplify_subreg (enum machine_mode outermode, rtx op,
       && (INTVAL (XEXP (op, 1)) % GET_MODE_BITSIZE (outermode)) == 0
       && INTVAL (XEXP (op, 1)) > 0
       && INTVAL (XEXP (op, 1)) < GET_MODE_BITSIZE (innermode)
-      && ! mode_dependent_address_p (XEXP (XEXP (op, 0), 0))
+      && ! mode_dependent_address_p (XEXP (XEXP (op, 0), 0),
+                                    MEM_ADDR_SPACE (XEXP (op, 0)))
       && ! MEM_VOLATILE_P (XEXP (op, 0))
       && byte == subreg_lowpart_offset (outermode, innermode)
       && (GET_MODE_SIZE (outermode) >= UNITS_PER_WORD
index 0d23c57a3fb1f01f947867b3ee0e2123d01fdf97..8922c783e04bf07d2a5263c34b7cb672c3a331d2 100644 (file)
@@ -1413,7 +1413,7 @@ DEFHOOK
 DEFHOOK
 (mode_dependent_address_p,
  "",
- bool, (const_rtx addr),
+ bool, (const_rtx addr, addr_space_t addrspace),
  default_mode_dependent_address_p)
 
 /* Given an invalid address X for a given machine mode, try machine-specific
index 36f998ac357cbcec1be64581e81bbf02d008461f..265fc9840d1eea0e86f9e1176718c55d5e93d126 100644 (file)
@@ -1202,7 +1202,8 @@ default_hard_regno_scratch_ok (unsigned int regno ATTRIBUTE_UNUSED)
 /* The default implementation of TARGET_MODE_DEPENDENT_ADDRESS_P.  */
 
 bool
-default_mode_dependent_address_p (const_rtx addr ATTRIBUTE_UNUSED)
+default_mode_dependent_address_p (const_rtx addr ATTRIBUTE_UNUSED,
+                                 addr_space_t addrspace ATTRIBUTE_UNUSED)
 {
   return false;
 }
index aa8b3baa3e89406ee77232512a51ff60eccb8640..e89f096bcfb5e5a2309657f09fa7613db4cfc3b9 100644 (file)
@@ -142,7 +142,7 @@ extern tree default_mangle_decl_assembler_name (tree, tree);
 extern tree default_emutls_var_fields (tree, tree *);
 extern tree default_emutls_var_init (tree, tree, tree);
 extern bool default_hard_regno_scratch_ok (unsigned int);
-extern bool default_mode_dependent_address_p (const_rtx addr);
+extern bool default_mode_dependent_address_p (const_rtx, addr_space_t);
 extern bool default_target_option_valid_attribute_p (tree, tree, tree, int);
 extern bool default_target_option_pragma_parse (tree, tree);
 extern bool default_target_can_inline_p (tree, tree);