aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-06-30 17:00:46 +0000
committerNathan Sidwell <nathan@acm.org>2017-06-30 17:00:46 +0000
commitf24ca8c00d7568a8204e5c7c51983e70e165e706 (patch)
treead3b95702069a60d64947311946c8789498fb972
parent42f9297fd9a6270b600b626dd22a4f3e85dd61cc (diff)
* ggc.h (empty_string): Delete.
* cfgexpand.c (expand_asm_stmt): Use plain "". * optabs.c (expand_asm_memory_barrier): Likewise. * stringpool.c (empty_string): Delete. (digit_vector, digit_string): Delete. (ggc_alloc_string): Use plain "", don't optimize single digit strings. Use ggc_alloc_atomic. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@249851 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog28
-rw-r--r--gcc/cfgexpand.c2
-rw-r--r--gcc/ggc.h3
-rw-r--r--gcc/optabs.c2
-rw-r--r--gcc/stringpool.c23
5 files changed, 25 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e0a9cc009aa..8fd5ef62882 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2017-06-30 Nathan Sidwell <nathan@acm.org>
+
+ * ggc.h (empty_string): Delete.
+ * cfgexpand.c (expand_asm_stmt): Use plain "".
+ * optabs.c (expand_asm_memory_barrier): Likewise.
+ * stringpool.c (empty_string): Delete.
+ (digit_vector, digit_string): Delete.
+ (ggc_alloc_string): Use plain "", don't optimize single digit
+ strings. Use ggc_alloc_atomic.
+
2017-06-30 Richard Earnshaw <rearnsha@arm.com>
* rtlanal.c (insn_rtx_cost): If a parallel contains exactly one
@@ -26,15 +36,15 @@
2017-06-30 Jakub Jelinek <jakub@redhat.com>
PR target/81225
- * config/i386/sse.md (vec_extract_lo_<mode><mask_name>): For
- V8FI, V16FI and VI8F_256 iterators, use <store_mask_predicate> instead
- of nonimmediate_operand and <store_mask_constraint> instead of m for
- the input operand. For V8FI iterator, always split if input is a MEM.
- For V16FI and V8SF_256 iterators, don't test if both operands are MEM
- if <mask_applied>. For VI4F_256 iterator, use <store_mask_predicate>
- instead of register_operand and <store_mask_constraint> instead of v for
- the input operand. Make sure both operands aren't MEMs for if not
- <mask_applied>.
+ * config/i386/sse.md (vec_extract_lo_<mode><mask_name>): For V8FI,
+ V16FI and VI8F_256 iterators, use <store_mask_predicate> instead
+ of nonimmediate_operand and <store_mask_constraint> instead of m
+ for the input operand. For V8FI iterator, always split if input
+ is a MEM. For V16FI and V8SF_256 iterators, don't test if both
+ operands are MEM if <mask_applied>. For VI4F_256 iterator, use
+ <store_mask_predicate> instead of register_operand and
+ <store_mask_constraint> instead of v for the input operand. Make
+ sure both operands aren't MEMs for if not <mask_applied>.
2017-06-30 Sylvestre Ledru <sylvestre@debian.org>
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 71662f21350..3b5f2fe270f 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -3165,7 +3165,7 @@ expand_asm_stmt (gasm *stmt)
rtx body = gen_rtx_ASM_OPERANDS ((noutputs == 0 ? VOIDmode
: GET_MODE (output_rvec[0])),
ggc_strdup (gimple_asm_string (stmt)),
- empty_string, 0, argvec, constraintvec,
+ "", 0, argvec, constraintvec,
labelvec, locus);
MEM_VOLATILE_P (body) = gimple_asm_volatile_p (stmt);
diff --git a/gcc/ggc.h b/gcc/ggc.h
index 2f4fa0fcbe1..9b5eb456779 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -24,9 +24,6 @@ along with GCC; see the file COPYING3. If not see
/* Symbols are marked with `ggc' for `gcc gc' so as not to interfere with
an external gc library that might be linked in. */
-/* Constants for general use. */
-extern const char empty_string[]; /* empty string */
-
/* Internal functions and data structures used by the GTY
machinery, including the generated gt*.[hc] files. */
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 9598adf84bf..8fd5d911ede 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -6278,7 +6278,7 @@ expand_asm_memory_barrier (void)
{
rtx asm_op, clob;
- asm_op = gen_rtx_ASM_OPERANDS (VOIDmode, empty_string, empty_string, 0,
+ asm_op = gen_rtx_ASM_OPERANDS (VOIDmode, "", "", 0,
rtvec_alloc (0), rtvec_alloc (0),
rtvec_alloc (0), UNKNOWN_LOCATION);
MEM_VOLATILE_P (asm_op) = 1;
diff --git a/gcc/stringpool.c b/gcc/stringpool.c
index 689327548e3..7aa4e8638d7 100644
--- a/gcc/stringpool.c
+++ b/gcc/stringpool.c
@@ -30,18 +30,6 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tree.h"
-/* The "" allocated string. */
-const char empty_string[] = "";
-
-/* Character strings, each containing a single decimal digit.
- Written this way to save space. */
-static const char digit_vector[] = {
- '0', 0, '1', 0, '2', 0, '3', 0, '4', 0,
- '5', 0, '6', 0, '7', 0, '8', 0, '9', 0
-};
-
-#define digit_string(d) (digit_vector + ((d) * 2))
-
struct ht *ident_hash;
static hashnode alloc_node (cpp_hash_table *);
@@ -82,19 +70,16 @@ alloc_node (cpp_hash_table *table ATTRIBUTE_UNUSED)
const char *
ggc_alloc_string (const char *contents, int length MEM_STAT_DECL)
{
- char *result;
-
if (length == -1)
length = strlen (contents);
- if (length == 0)
- return empty_string;
- if (length == 1 && ISDIGIT (contents[0]))
- return digit_string (contents[0] - '0');
+ if (!length)
+ return "";
- result = (char *) ggc_internal_cleared_alloc (length + 1 PASS_MEM_STAT);
+ char *result = (char *) ggc_alloc_atomic (length + 1);
memcpy (result, contents, length);
result[length] = '\0';
+
return (const char *) result;
}