aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2021-01-05 20:55:09 +0100
committerIlya Leoshkevich <iii@linux.ibm.com>2021-03-04 14:33:41 +0100
commite52ef6e60d7a6d6f57b67415c73621ccc79d5440 (patch)
tree748d8b9122bf5fc6a66e7ea0e7bb06dcfd8c4c1c /gcc/cfgexpand.c
parentaf60228addb5a8b6294d2ba9e81e134d359ca043 (diff)
downloadgcc-e52ef6e60d7a6d6f57b67415c73621ccc79d5440.zip
gcc-e52ef6e60d7a6d6f57b67415c73621ccc79d5440.tar.gz
gcc-e52ef6e60d7a6d6f57b67415c73621ccc79d5440.tar.bz2
Add input_modes parameter to TARGET_MD_ASM_ADJUST hook
If TARGET_MD_ASM_ADJUST changes a mode of an input operand (which should be ok as long as the hook itself as well as after_md_seq make up for it), input_mode will contain stale information. It might be tempting to fix this by removing input_mode altogether and just using GET_MODE (), but this will not work correctly with constants. So add input_modes parameter and document that it should be updated whenever inputs parameter is updated. gcc/ChangeLog: 2021-01-05 Ilya Leoshkevich <iii@linux.ibm.com> * cfgexpand.c (expand_asm_loc): Pass new parameter. (expand_asm_stmt): Likewise. * config/arm/aarch-common-protos.h (arm_md_asm_adjust): Add new parameter. * config/arm/aarch-common.c (arm_md_asm_adjust): Likewise. * config/arm/arm.c (thumb1_md_asm_adjust): Likewise. * config/cris/cris.c (cris_md_asm_adjust): Likewise. * config/i386/i386.c (ix86_md_asm_adjust): Likewise. * config/mn10300/mn10300.c (mn10300_md_asm_adjust): Likewise. * config/nds32/nds32.c (nds32_md_asm_adjust): Likewise. * config/pdp11/pdp11.c (pdp11_md_asm_adjust): Likewise. * config/rs6000/rs6000.c (rs6000_md_asm_adjust): Likewise. * config/vax/vax.c (vax_md_asm_adjust): Likewise. * config/visium/visium.c (visium_md_asm_adjust): Likewise. * doc/tm.texi (md_asm_adjust): Likewise. * target.def (md_asm_adjust): Likewise.
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index aef9e91..a6b48d3 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2880,6 +2880,7 @@ expand_asm_loc (tree string, int vol, location_t locus)
rtx asm_op, clob;
unsigned i, nclobbers;
auto_vec<rtx> input_rvec, output_rvec;
+ auto_vec<machine_mode> input_mode;
auto_vec<const char *> constraints;
auto_vec<rtx> clobber_rvec;
HARD_REG_SET clobbered_regs;
@@ -2889,9 +2890,8 @@ expand_asm_loc (tree string, int vol, location_t locus)
clobber_rvec.safe_push (clob);
if (targetm.md_asm_adjust)
- targetm.md_asm_adjust (output_rvec, input_rvec,
- constraints, clobber_rvec,
- clobbered_regs);
+ targetm.md_asm_adjust (output_rvec, input_rvec, input_mode,
+ constraints, clobber_rvec, clobbered_regs);
asm_op = body;
nclobbers = clobber_rvec.length ();
@@ -3068,8 +3068,8 @@ expand_asm_stmt (gasm *stmt)
return;
}
- /* There are some legacy diagnostics in here, and also avoids a
- sixth parameger to targetm.md_asm_adjust. */
+ /* There are some legacy diagnostics in here, and also avoids an extra
+ parameter to targetm.md_asm_adjust. */
save_input_location s_i_l(locus);
unsigned noutputs = gimple_asm_noutputs (stmt);
@@ -3420,9 +3420,9 @@ expand_asm_stmt (gasm *stmt)
the flags register. */
rtx_insn *after_md_seq = NULL;
if (targetm.md_asm_adjust)
- after_md_seq = targetm.md_asm_adjust (output_rvec, input_rvec,
- constraints, clobber_rvec,
- clobbered_regs);
+ after_md_seq
+ = targetm.md_asm_adjust (output_rvec, input_rvec, input_mode,
+ constraints, clobber_rvec, clobbered_regs);
/* Do not allow the hook to change the output and input count,
lest it mess up the operand numbering. */