Add input_modes parameter to TARGET_MD_ASM_ADJUST hook
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 5 Jan 2021 19:55:09 +0000 (20:55 +0100)
committerIlya Leoshkevich <iii@linux.ibm.com>
Thu, 4 Mar 2021 13:33:41 +0000 (14:33 +0100)
commite52ef6e60d7a6d6f57b67415c73621ccc79d5440
tree748d8b9122bf5fc6a66e7ea0e7bb06dcfd8c4c1c
parentaf60228addb5a8b6294d2ba9e81e134d359ca043
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.
14 files changed:
gcc/cfgexpand.c
gcc/config/arm/aarch-common-protos.h
gcc/config/arm/aarch-common.c
gcc/config/arm/arm.c
gcc/config/cris/cris.c
gcc/config/i386/i386.c
gcc/config/mn10300/mn10300.c
gcc/config/nds32/nds32.c
gcc/config/pdp11/pdp11.c
gcc/config/rs6000/rs6000.c
gcc/config/vax/vax.c
gcc/config/visium/visium.c
gcc/doc/tm.texi
gcc/target.def