aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2020-02-11 02:20:56 +0000
committerSegher Boessenkool <segher@kernel.crashing.org>2020-02-12 02:05:00 +0000
commitd9e067f98b0c4f57d8acd60526b6fa11a1d109e5 (patch)
tree6b4cf31dac361bde2dc32c490d95057fdeaeb6a3
parent35e24106fc1b782e70f8339e0a1321a2bc7a7f15 (diff)
downloadgcc-d9e067f98b0c4f57d8acd60526b6fa11a1d109e5.zip
gcc-d9e067f98b0c4f57d8acd60526b6fa11a1d109e5.tar.gz
gcc-d9e067f98b0c4f57d8acd60526b6fa11a1d109e5.tar.bz2
rs6000: Use strlen instead of sizeof - 1
It is easier to read and understand strlen ("string") than it is to read and understand sizeof ("string") - 1 . * config/rs6000/rs6000.c (rs6000_debug_print_mode): Don't use sizeof where strlen is more legible. (rs6000_builtin_vectorized_libmass): Ditto. (rs6000_print_options_internal): Ditto.
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/rs6000/rs6000.c12
2 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2f6dbdc..3ff6620 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2020-02-12 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * config/rs6000/rs6000.c (rs6000_debug_print_mode): Don't use sizeof
+ where strlen is more legible.
+ (rs6000_builtin_vectorized_libmass): Ditto.
+ (rs6000_print_options_internal): Ditto.
+
2020-02-11 Martin Sebor <msebor@redhat.com>
PR tree-optimization/93683
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index cf73e11..4c1c0e9 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -2135,7 +2135,7 @@ rs6000_debug_print_mode (ssize_t m)
spaces = 0;
}
else
- spaces += sizeof (" Reload=sl") - 1;
+ spaces += strlen (" Reload=sl");
if (reg_addr[m].scalar_in_vmx_p)
{
@@ -2143,7 +2143,7 @@ rs6000_debug_print_mode (ssize_t m)
spaces = 0;
}
else
- spaces += sizeof (" Upper=y") - 1;
+ spaces += strlen (" Upper=y");
if (rs6000_vector_unit[m] != VECTOR_NONE
|| rs6000_vector_mem[m] != VECTOR_NONE)
@@ -5206,7 +5206,7 @@ rs6000_builtin_vectorized_libmass (combined_fn fn, tree type_out,
if (!bname)
return NULL_TREE;
- strcpy (name, bname + sizeof ("__builtin_") - 1);
+ strcpy (name, bname + strlen ("__builtin_"));
strcat (name, suffix);
if (n_args == 1)
@@ -23547,7 +23547,7 @@ rs6000_print_options_internal (FILE *file,
if ((flags & mask) == 0)
{
no_str = "no-";
- len += sizeof ("no-") - 1;
+ len += strlen ("no-");
}
flags &= ~mask;
@@ -23558,7 +23558,7 @@ rs6000_print_options_internal (FILE *file,
if ((flags & mask) != 0)
{
no_str = "no-";
- len += sizeof ("no-") - 1;
+ len += strlen ("no-");
}
flags |= mask;
@@ -23574,7 +23574,7 @@ rs6000_print_options_internal (FILE *file,
fprintf (file, "%s%s%s%s", comma, prefix, no_str, name);
comma = ", ";
- comma_len = sizeof (", ") - 1;
+ comma_len = strlen (", ");
}
fputs ("\n", file);