diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-10 15:13:54 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-10 15:13:54 +0000 |
commit | 8cff878b277f9af6c2827a87581baac5f768e12a (patch) | |
tree | d4e178503efd243eed24ff3b753cd998370d75d4 /gcc/gengenrtl.c | |
parent | 9610b14f8599a9db94822d3f0923b58b2f1177dc (diff) | |
download | gcc-8cff878b277f9af6c2827a87581baac5f768e12a.tar.gz |
[./]
2016-02-10 Basile Starynkevitch <basile@starynkevitch.net>
{{merging with some of GCC 6, using
svn merge -r222130:226090 ^/trunk ; UNSTABLE}}
[gcc/]
2016-02-10 Basile Starynkevitch <basile@starynkevitch.net>
{{ merging with trunk 226090 ; UNSTABLE }}
* melt-run.proto.h: include tree-ssa-scopedtables.h
* tree-ssa-dom.c: skip second record_edge_info
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@233272 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gengenrtl.c')
-rw-r--r-- | gcc/gengenrtl.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index ae765bfaa70..34f0de346a2 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -113,7 +113,16 @@ special_format (const char *fmt) return (strchr (fmt, '*') != 0 || strchr (fmt, 'V') != 0 || strchr (fmt, 'S') != 0 - || strchr (fmt, 'n') != 0); + || strchr (fmt, 'n') != 0 + || strchr (fmt, 'r') != 0); +} + +/* Return true if CODE always has VOIDmode. */ + +static inline bool +always_void_p (int idx) +{ + return strcmp (defs[idx].enumname, "SET") == 0; } /* Return nonzero if the RTL code given by index IDX is one that we should @@ -181,6 +190,7 @@ static void genmacro (int idx) { const char *p; + const char *sep = ""; int i; /* We write a macro that defines gen_rtx_RTLCODE to be an equivalent to @@ -190,15 +200,25 @@ genmacro (int idx) /* Don't define a macro for this code. */ return; - printf ("#define gen_rtx_%s%s(MODE", + bool has_mode_p = !always_void_p (idx); + printf ("#define gen_rtx_%s%s(", special_rtx (idx) ? "raw_" : "", defs[idx].enumname); + if (has_mode_p) + { + printf ("MODE"); + sep = ", "; + } for (p = defs[idx].format, i = 0; *p != 0; p++) if (*p != '0') - printf (", ARG%d", i++); + { + printf ("%sARG%d", sep, i++); + sep = ", "; + } - printf (") \\\n gen_rtx_fmt_%s (%s, (MODE)", - defs[idx].format, defs[idx].enumname); + printf (") \\\n gen_rtx_fmt_%s (%s, %s", + defs[idx].format, defs[idx].enumname, + has_mode_p ? "(MODE)" : "VOIDmode"); for (p = defs[idx].format, i = 0; *p != 0; p++) if (*p != '0') @@ -232,7 +252,7 @@ gendef (const char *format) puts (" rtx rt;"); puts (" rt = rtx_alloc_stat (code PASS_MEM_STAT);\n"); - puts (" PUT_MODE (rt, mode);"); + puts (" PUT_MODE_RAW (rt, mode);"); for (p = format, i = j = 0; *p ; ++p, ++i) if (*p != '0') |