[gcc(refs/users/wschmidt/heads/builtins3)] rs6000: Some builtin debug modifications
William Schmidt
wschmidt@gcc.gnu.org
Thu Oct 29 19:52:22 GMT 2020
https://gcc.gnu.org/g:3e5daa1761db939590abf39266cba15ccc3f2abb
commit 3e5daa1761db939590abf39266cba15ccc3f2abb
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date: Fri Jul 31 12:40:10 2020 -0500
rs6000: Some builtin debug modifications
2020-07-31 Bill Schmidt <wschmidt@linux.ibm.com>
* rs6000-gen-builtins.c (write_init_bif_table): Change form of
attr_string; add code to dump builtins to stderr under macro
control.
Diff:
---
gcc/config/rs6000/rs6000-gen-builtins.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c
index d2c029c0fb5..1d83215b32a 100644
--- a/gcc/config/rs6000/rs6000-gen-builtins.c
+++ b/gcc/config/rs6000/rs6000-gen-builtins.c
@@ -2336,13 +2336,13 @@ write_init_bif_table ()
{
fprintf (init_file, " TREE_READONLY (t) = 1;\n");
fprintf (init_file, " TREE_NOTHROW (t) = 1;\n");
- attr_string = ", const";
+ attr_string = "= const";
}
else if (bifs[i].kind == FNK_PURE)
{
fprintf (init_file, " DECL_PURE_P (t) = 1;\n");
fprintf (init_file, " TREE_NOTHROW (t) = 1;\n");
- attr_string = ", pure";
+ attr_string = "= pure";
}
else if (bifs[i].kind == FNK_FPMATH)
{
@@ -2352,11 +2352,33 @@ write_init_bif_table ()
fprintf (init_file, " DECL_PURE_P (t) = 1;\n");
fprintf (init_file, " DECL_IS_NOVOPS (t) = 1;\n");
fprintf (init_file, " }\n");
- attr_string = ", fp, const";
+ attr_string = "= fp, const";
}
else
attr_string = "";
+#ifdef BILLDEBUG
+ char *buf = (char *) malloc (strlen (bifs[i].fndecl) + 1);
+ strcpy (buf, bifs[i].fndecl);
+ char *tok = strtok (buf, "_");
+ const char *str = map_token_to_type_node (tok);
+ fprintf (stderr, "%s %s (", str, bifs[i].proto.bifname);
+ tok = strtok (0, "_");
+ assert (tok);
+ assert (!strcmp (tok, "ftype"));
+ tok = strtok (0, "_");
+ while (tok && strcmp (tok, "v"))
+ {
+ str = map_token_to_type_node (tok);
+ fprintf (stderr, "%s", str);
+ tok = strtok (0, "_");
+ if (tok)
+ fprintf (stderr, ", ");
+ }
+ fprintf (stderr, "); %s [%4d] %s\n", attr_string, i,
+ enable_string[bifs[i].stanza]);
+#endif
+
fprintf (init_file, " if (TARGET_DEBUG_BUILTIN)\n");
fprintf (init_file, " fprintf (stderr, \"rs6000_builtin"
", code = %4d, \"\n \"%s%s\\n\");\n",
More information about the Gcc-cvs
mailing list