summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-cppbuiltin.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-14 12:30:29 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-14 12:30:29 +0000
commit59805910dc260c5cdfca5ae9524a6bced9246d72 (patch)
treee71b7a923da3e97aad52cfbe029d629009a66b0a /gcc/c-family/c-cppbuiltin.c
parentced4f0683dc4335e9aaf7f546df6514b638846c9 (diff)
downloadgcc-59805910dc260c5cdfca5ae9524a6bced9246d72.tar.gz
PR bootstrap/44509
* c-config-lang.in (gtfiles): Add c-family/c-cppbuiltin.c. * c-family/c-cppbuiltin.c: Include gt-c-family-c-cppbuiltin.h. (lazy_hex_fp_values, lazy_hex_fp_value_count): Add GTY(()) markers. (lazy_hex_fp_value, builtin_define_with_hex_fp_value): Use ggc_strdup instead of xstrdup. * gcc.dg/pr44509.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160729 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-cppbuiltin.c')
-rw-r--r--gcc/c-family/c-cppbuiltin.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 4ed6975e45b..77a92c39584 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -951,15 +951,16 @@ builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value)
array and function allows it to be done lazily when __DBL_MAX__
etc. is first used. */
-static struct
+struct GTY(()) lazy_hex_fp_value_struct
{
const char *hex_str;
cpp_macro *macro;
enum machine_mode mode;
int digits;
const char *fp_suffix;
-} lazy_hex_fp_values[12];
-static int lazy_hex_fp_value_count;
+};
+static GTY(()) struct lazy_hex_fp_value_struct lazy_hex_fp_values[12];
+static GTY(()) int lazy_hex_fp_value_count;
static bool
lazy_hex_fp_value (cpp_reader *pfile ATTRIBUTE_UNUSED,
@@ -987,7 +988,7 @@ lazy_hex_fp_value (cpp_reader *pfile ATTRIBUTE_UNUSED,
gcc_assert (idx < node->value.macro->count);
node->value.macro->exp.tokens[idx].val.str.len = strlen (buf1);
node->value.macro->exp.tokens[idx].val.str.text
- = (const unsigned char *) xstrdup (buf1);
+ = (const unsigned char *) ggc_strdup (buf1);
return true;
}
@@ -1014,7 +1015,8 @@ builtin_define_with_hex_fp_value (const char *macro,
sprintf (buf1, "%s=%s", macro, buf2);
cpp_define (parse_in, buf1);
node = C_CPP_HASHNODE (get_identifier (macro));
- lazy_hex_fp_values[lazy_hex_fp_value_count].hex_str = xstrdup (hex_str);
+ lazy_hex_fp_values[lazy_hex_fp_value_count].hex_str
+ = ggc_strdup (hex_str);
lazy_hex_fp_values[lazy_hex_fp_value_count].mode = TYPE_MODE (type);
lazy_hex_fp_values[lazy_hex_fp_value_count].digits = digits;
lazy_hex_fp_values[lazy_hex_fp_value_count].fp_suffix = fp_suffix;
@@ -1173,3 +1175,5 @@ builtin_define_type_minmax (const char *min_macro, const char *max_macro,
cpp_define (parse_in, buf);
}
}
+
+#include "gt-c-family-c-cppbuiltin.h"