diff options
author | Jeff Law <jlaw@localhost.localdomain> | 2021-07-20 14:49:54 -0400 |
---|---|---|
committer | Jeff Law <jlaw@localhost.localdomain> | 2021-07-20 14:54:15 -0400 |
commit | 818203714e8640ce29c886b5060c91b12ad3a7c4 (patch) | |
tree | bf81c792f451ff976e0b753e7c7bf568b48b85c2 /gcc/function.c | |
parent | 00dcc88a0ed7bd148ea86d900b6c93574a2e1f26 (diff) | |
download | gcc-818203714e8640ce29c886b5060c91b12ad3a7c4.zip gcc-818203714e8640ce29c886b5060c91b12ad3a7c4.tar.gz gcc-818203714e8640ce29c886b5060c91b12ad3a7c4.tar.bz2 |
Attach MEM_EXPR information when flushing BLKmode args to the stack - V2
gcc/
* function.c (assign_parm_setup_block): Use adjust_address instead
of change_address to preserve MEM_EXPR and friends.
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c index 00b2fe7..af3d57b 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3036,7 +3036,15 @@ assign_parm_setup_block (struct assign_parm_data_all *all, reg = gen_rtx_REG (word_mode, REGNO (entry_parm)); reg = convert_to_mode (mode, copy_to_reg (reg), 1); } - emit_move_insn (change_address (mem, mode, 0), reg); + + /* We use adjust_address to get a new MEM with the mode + changed. adjust_address is better than change_address + for this purpose because adjust_address does not lose + the MEM_EXPR associated with the MEM. + + If the MEM_EXPR is lost, then optimizations like DSE + assume the MEM escapes and thus is not subject to DSE. */ + emit_move_insn (adjust_address (mem, mode, 0), reg); } #ifdef BLOCK_REG_PADDING |