diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2021-01-05 20:55:09 +0100 |
---|---|---|
committer | Ilya Leoshkevich <iii@linux.ibm.com> | 2021-03-04 14:33:41 +0100 |
commit | e52ef6e60d7a6d6f57b67415c73621ccc79d5440 (patch) | |
tree | 748d8b9122bf5fc6a66e7ea0e7bb06dcfd8c4c1c /gcc/target.def | |
parent | af60228addb5a8b6294d2ba9e81e134d359ca043 (diff) | |
download | gcc-e52ef6e60d7a6d6f57b67415c73621ccc79d5440.tar.gz |
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/target.def')
-rw-r--r-- | gcc/target.def | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/target.def b/gcc/target.def index d9e151bb129..d7b94bd8e5d 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -4172,12 +4172,15 @@ DEFHOOK clobber for an asm. The @var{outputs} and @var{inputs} may be inspected\n\ to avoid clobbering a register that is already used by the asm.\n\ \n\ -It may modify the @var{outputs}, @var{inputs}, and @var{constraints}\n\ -as necessary for other pre-processing. In this case the return value is\n\ -a sequence of insns to emit after the asm.", +It may modify the @var{outputs}, @var{inputs}, @var{input_modes}, and\n\ +@var{constraints} as necessary for other pre-processing. In this case the\n\ +return value is a sequence of insns to emit after the asm. Note that\n\ +changes to @var{inputs} must be accompanied by the corresponding changes\n\ +to @var{input_modes}.", rtx_insn *, - (vec<rtx>& outputs, vec<rtx>& inputs, vec<const char *>& constraints, - vec<rtx>& clobbers, HARD_REG_SET& clobbered_regs), + (vec<rtx>& outputs, vec<rtx>& inputs, vec<machine_mode>& input_modes, + vec<const char *>& constraints, vec<rtx>& clobbers, + HARD_REG_SET& clobbered_regs), NULL) /* This target hook allows the backend to specify a calling convention |