[Patch] PR target/63937 TARGET_USE_BY_PIECES_INFRASTRUCTURE_P should take an unsigned...
authorJames Greenhalgh <james.greenhalgh@arm.com>
Tue, 18 Nov 2014 22:45:21 +0000 (22:45 +0000)
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>
Tue, 18 Nov 2014 22:45:21 +0000 (22:45 +0000)
gcc/

PR target/63937
* target.def (use_by_pieces_infrastructure_p): Take unsigned
HOST_WIDE_INT as the size parameter.
* targhooks.c (default_use_by_pieces_infrastructure_p): Likewise.
* targhooks.h (default_use_by_pieces_infrastructure_p): Likewise.
* config/arc/arc.c (arc_use_by_pieces_infrastructure_p)): Likewise.
* config/mips/mips.c (mips_use_by_pieces_infrastructure_p)): Likewise.
* config/s390/s390.c (s390_use_by_pieces_infrastructure_p)): Likewise.
* config/sh/sh.c (sh_use_by_pieces_infrastructure_p)): Likewise.
* config/aarch64/aarch64.c
(aarch64_use_by_pieces_infrastructure_p)): Likewise.
* doc/tm.texi: Regenerate.

gcc/testsuite/

PR target/63937
* gcc.dg/memset-2.c: New.

From-SVN: r217742

12 files changed:
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/arc/arc.c
gcc/config/mips/mips.c
gcc/config/s390/s390.c
gcc/config/sh/sh.c
gcc/doc/tm.texi
gcc/target.def
gcc/targhooks.c
gcc/targhooks.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/memset-2.c [new file with mode: 0644]

index 647902bb678259697a56e38c81a373bc4e832e5c..5072b44f8ff3b9c4869883f9e5c847bf79def545 100644 (file)
@@ -1,3 +1,18 @@
+2014-11-18  James Greenhalgh  <james.greenhalgh@arm.com>
+
+       PR target/63937
+       * target.def (use_by_pieces_infrastructure_p): Take unsigned
+       HOST_WIDE_INT as the size parameter.
+       * targhooks.c (default_use_by_pieces_infrastructure_p): Likewise.
+       * targhooks.h (default_use_by_pieces_infrastructure_p): Likewise.
+       * config/arc/arc.c (arc_use_by_pieces_infrastructure_p)): Likewise.
+       * config/mips/mips.c (mips_use_by_pieces_infrastructure_p)): Likewise.
+       * config/s390/s390.c (s390_use_by_pieces_infrastructure_p)): Likewise.
+       * config/sh/sh.c (sh_use_by_pieces_infrastructure_p)): Likewise.
+       * config/aarch64/aarch64.c
+       (aarch64_use_by_pieces_infrastructure_p)): Likewise.
+       * doc/tm.texi: Regenerate.
+
 2014-11-18  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn.
index 4fec21ec88ceb6664f8a5596db2a547b538fdecc..a53f942ad7f5d48f36fcb19c091a3a7299e385a0 100644 (file)
@@ -10196,7 +10196,7 @@ aarch64_asan_shadow_offset (void)
 }
 
 static bool
-aarch64_use_by_pieces_infrastructure_p (unsigned int size,
+aarch64_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size,
                                        unsigned int align,
                                        enum by_pieces_operation op,
                                        bool speed_p)
index 0f3825e10e5014c0aef16847a288cce433bb9978..764f7366c9aa912545ddd01f1239db7d472376e9 100644 (file)
@@ -416,7 +416,7 @@ static void output_short_suffix (FILE *file);
 
 static bool arc_frame_pointer_required (void);
 
-static bool arc_use_by_pieces_infrastructure_p (unsigned int,
+static bool arc_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT,
                                                unsigned int,
                                                enum by_pieces_operation op,
                                                bool);
@@ -9374,7 +9374,7 @@ arc_legitimize_reload_address (rtx *p, machine_mode mode, int opnum,
 /* Implement TARGET_USE_BY_PIECES_INFRASTRUCTURE_P.  */
 
 static bool
-arc_use_by_pieces_infrastructure_p (unsigned int size,
+arc_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size,
                                    unsigned int align,
                                    enum by_pieces_operation op,
                                    bool speed_p)
index 02268f3247e45029e691d8e27147953244fdd904..db58d076e53d902463c02fdf5f76145c3a6a89e4 100644 (file)
@@ -7235,7 +7235,7 @@ mips_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
 /* Implement TARGET_USE_MOVE_BY_PIECES_INFRASTRUCTURE_P.  */
 
 bool
-mips_use_by_pieces_infrastructure_p (unsigned int size,
+mips_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size,
                                     unsigned int align,
                                     enum by_pieces_operation op,
                                     bool speed_p)
index 31527624be40184e44cc7293d56334721b85eb7c..ae3ffd12db1e2e5222288026cfae4094333f215f 100644 (file)
@@ -12036,7 +12036,7 @@ s390_option_override (void)
 /* Implement TARGET_USE_BY_PIECES_INFRASTRUCTURE_P.  */
 
 static bool
-s390_use_by_pieces_infrastructure_p (unsigned int size,
+s390_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size,
                                     unsigned int align ATTRIBUTE_UNUSED,
                                     enum by_pieces_operation op ATTRIBUTE_UNUSED,
                                     bool speed_p ATTRIBUTE_UNUSED)
index 5bac2afbcbc64aed15c65bd4c7dc52d0d4a86fa8..e44912105224ebabcbbe80c2df506148dc81bbcd 100644 (file)
@@ -338,7 +338,7 @@ static void sh_conditional_register_usage (void);
 static bool sh_legitimate_constant_p (machine_mode, rtx);
 static int mov_insn_size (machine_mode, bool);
 static int mov_insn_alignment_mask (machine_mode, bool);
-static bool sh_use_by_pieces_infrastructure_p (unsigned int,
+static bool sh_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT,
                                               unsigned int,
                                               enum by_pieces_operation,
                                               bool);
@@ -13680,7 +13680,7 @@ sh_mode_priority (int entity ATTRIBUTE_UNUSED, int n)
 /* Implement TARGET_USE_BY_PIECES_INFRASTRUCTURE_P.  */
 
 static bool
-sh_use_by_pieces_infrastructure_p (unsigned int size,
+sh_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size,
                                   unsigned int align,
                                   enum by_pieces_operation op,
                                   bool speed_p)
index c09c51030ef66a3b42cb446a7041ba3f69cc2596..0d3a9fd9b9a7e6b0a5f1063cc204810d977f0c40 100644 (file)
@@ -6205,7 +6205,7 @@ optimized for speed rather than size.
 If you don't define this, a reasonable default is used.
 @end defmac
 
-@deftypefn {Target Hook} bool TARGET_USE_BY_PIECES_INFRASTRUCTURE_P (unsigned int @var{size}, unsigned int @var{alignment}, enum by_pieces_operation @var{op}, bool @var{speed_p})
+@deftypefn {Target Hook} bool TARGET_USE_BY_PIECES_INFRASTRUCTURE_P (unsigned HOST_WIDE_INT @var{size}, unsigned int @var{alignment}, enum by_pieces_operation @var{op}, bool @var{speed_p})
 GCC will attempt several strategies when asked to copy between
 two areas of memory, or to set, clear or store to memory, for example
 when copying a @code{struct}. The @code{by_pieces} infrastructure
index 3ccb028a61e62ffd7cee87db3abef247f84ee726..bc5160d1805940023e94370a8c0bf1a12636b0a5 100644 (file)
@@ -3314,7 +3314,7 @@ the body of the memory operation.\n\
 Returning true for higher values of @code{size} may also cause an increase\n\
 in code size, for example where the number of insns emitted to perform a\n\
 move would be greater than that of a library call.",
- bool, (unsigned int size, unsigned int alignment,
+ bool, (unsigned HOST_WIDE_INT size, unsigned int alignment,
         enum by_pieces_operation op, bool speed_p),
  default_use_by_pieces_infrastructure_p)
 
index 7b1b5dcfee4834c3be3e4130baca664defac6612..bef18872bbab9b1355862d67524e27443754d273 100644 (file)
@@ -1430,7 +1430,7 @@ get_move_ratio (bool speed_p ATTRIBUTE_UNUSED)
    a call to memcpy emitted.  */
 
 bool
-default_use_by_pieces_infrastructure_p (unsigned int size,
+default_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size,
                                        unsigned int alignment,
                                        enum by_pieces_operation op,
                                        bool speed_p)
index faadd23c887cdef6517602801810756ce5d41ed8..9734220dea2f998ee17e2834695b8d9b698cc14d 100644 (file)
@@ -181,7 +181,7 @@ extern int default_memory_move_cost (machine_mode, reg_class_t, bool);
 extern int default_register_move_cost (machine_mode, reg_class_t,
                                       reg_class_t);
 
-extern bool default_use_by_pieces_infrastructure_p (unsigned int,
+extern bool default_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT,
                                                    unsigned int,
                                                    enum by_pieces_operation,
                                                    bool);
index 49f497396f71b1bf4e30b0a1d4e1405aa7eb92f4..1a56e1ac9edbdea8a188db8f647713ebe5c6d68a 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-18  James Greenhalgh  <james.greenhalgh@arm.com>
+
+       PR target/63937
+       * gcc.dg/memset-2.c: New.
+
 2014-11-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR sanitizer/63813
diff --git a/gcc/testsuite/gcc.dg/memset-2.c b/gcc/testsuite/gcc.dg/memset-2.c
new file mode 100644 (file)
index 0000000..fb4debc
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR target/63937 */
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O2" } */
+
+void
+foo (char *p)
+{
+  p = __builtin_assume_aligned (p, 64);
+  __builtin_memset (p, 0, 0x100000001ULL);
+}
+