diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2021-01-08 01:50:10 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2021-01-09 15:46:02 +0000 |
commit | 859be2e44aceb3766e4517e827e2aad7c9711b4c (patch) | |
tree | 0000d327625f9c5679ea62be07ad2c1c49d52538 /gcc/read-rtl.c | |
parent | 991656092f78eeab2a48fdbacf4e1f08567badaf (diff) | |
download | gcc-859be2e44aceb3766e4517e827e2aad7c9711b4c.zip gcc-859be2e44aceb3766e4517e827e2aad7c9711b4c.tar.gz gcc-859be2e44aceb3766e4517e827e2aad7c9711b4c.tar.bz2 |
RTL: Update `const_double_zero' handling for mode and callable insns
Handle machine mode specification with `const_double_zero' and handle
the rtx with callable code produced from named insns. Complementing
commit 20ab43b5cad6 ("RTL: Add `const_double_zero' syntactic rtx") and
removing a commit c60d0736dff7 ("PDP11: Use `const_double_zero' to
express double zero constant") build regression observed with the
`pdp11-aout' target:
genemit: Internal error: abort in gen_exp, at genemit.c:202
make[2]: *** [Makefile:2427: s-emit] Error 1
where a:
(const_double 0 [0] 0 [0] 0 [0] 0 [0])
rtx coming from:
(parallel [
(set (reg:CC 16)
(compare:CC (abs:DF (match_operand:DF 1 ("general_operand") ("0,0")))
(const_double 0 [0] 0 [0] 0 [0] 0 [0])))
(set (match_operand:DF 0 ("nonimmediate_operand") ("=fR,Q"))
(abs:DF (match_dup 1)))
])
and ultimately `(const_double_zero)' referred in a named RTL insn cannot
be interpreted. Handle the rtx then by supplying the constant 0 double
operand requested, resulting in the following update to insn-emit.c code
produced for the `pdp11-aout' target, relative to before the triggering
commit:
@@ -1514,7 +1514,7 @@ gen_absdf2_cc (rtx operand0 ATTRIBUTE_UN
gen_rtx_COMPARE (CCmode,
gen_rtx_ABS (DFmode,
operand1),
- const0_rtx)),
+ CONST_DOUBLE_ATOF ("0", VOIDmode))),
gen_rtx_SET (operand0,
gen_rtx_ABS (DFmode,
copy_rtx (operand1)))));
@@ -1555,7 +1555,7 @@ gen_negdf2_cc (rtx operand0 ATTRIBUTE_UN
gen_rtx_COMPARE (CCmode,
gen_rtx_NEG (DFmode,
operand1),
- const0_rtx)),
+ CONST_DOUBLE_ATOF ("0", VOIDmode))),
gen_rtx_SET (operand0,
gen_rtx_NEG (DFmode,
copy_rtx (operand1)))));
@@ -1790,7 +1790,7 @@ gen_muldf3_cc (rtx operand0 ATTRIBUTE_UN
gen_rtx_MULT (DFmode,
operand1,
operand2),
- const0_rtx)),
+ CONST_DOUBLE_ATOF ("0", VOIDmode))),
gen_rtx_SET (operand0,
gen_rtx_MULT (DFmode,
copy_rtx (operand1),
@@ -1942,7 +1942,7 @@ gen_divdf3_cc (rtx operand0 ATTRIBUTE_UN
gen_rtx_DIV (DFmode,
operand1,
operand2),
- const0_rtx)),
+ CONST_DOUBLE_ATOF ("0", VOIDmode))),
gen_rtx_SET (operand0,
gen_rtx_DIV (DFmode,
copy_rtx (operand1),
This does not (yet) remove VOIDmode CONST_DOUBLE use, as it is up to
individual machine descriptions to choose.
gcc/
* genemit.c (gen_exp) <CONST_DOUBLE>: Handle `const_double_zero'
rtx.
* read-rtl.c (rtx_reader::read_rtx_code): Handle machine mode
with `const_double_zero'.
* doc/rtl.texi (Constant Expression Types): Document it.
Diffstat (limited to 'gcc/read-rtl.c')
-rw-r--r-- | gcc/read-rtl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c index 11e2686..9254028 100644 --- a/gcc/read-rtl.c +++ b/gcc/read-rtl.c @@ -1658,6 +1658,15 @@ rtx_reader::read_rtx_code (const char *code_name) return_rtx = rtx_alloc (code); memset (return_rtx, 0, RTX_CODE_SIZE (code)); PUT_CODE (return_rtx, code); + c = read_skip_spaces (); + if (c == ':') + { + file_location loc = read_name (&name); + record_potential_iterator_use (&modes, loc, return_rtx, 0, + name.string); + } + else + unread_char (c); return return_rtx; } |