diff options
author | Martin Liska <mliska@suse.cz> | 2018-04-13 10:35:32 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-04-13 10:35:32 +0200 |
commit | fdd332545cacd845162103bf9855c4605be73584 (patch) | |
tree | 2c2fff0f0c8d64c99dc10974991256116f113a2f /gcc/expr.c | |
parent | 6888a172d3e9a19921783a31fd8bce5bde8a9c31 (diff) | |
download | gcc-fdd332545cacd845162103bf9855c4605be73584.zip gcc-fdd332545cacd845162103bf9855c4605be73584.tar.gz gcc-fdd332545cacd845162103bf9855c4605be73584.tar.bz2 |
re PR middle-end/81657 (FAIL: gcc.dg/20050503-1.c scan-assembler-not call)
PR middle-end/81657
* expr.h (enum block_op_methods): Add BLOCK_OP_NO_LIBCALL_RET.
* expr.c (emit_block_move_hints): Handle BLOCK_OP_NO_LIBCALL_RET.
* builtins.c (expand_builtin_memory_copy_args): Use
BLOCK_OP_NO_LIBCALL_RET method for mempcpy with non-ignored target,
handle dest_addr == pc_rtx.
* gcc.dg/string-opt-1.c: Remove bogus comment. Expect a mempcpy
call.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r259366
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1565,7 +1565,7 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method, unsigned HOST_WIDE_INT max_size, unsigned HOST_WIDE_INT probable_max_size) { - bool may_use_call; + int may_use_call; rtx retval = 0; unsigned int align; @@ -1577,7 +1577,7 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method, { case BLOCK_OP_NORMAL: case BLOCK_OP_TAILCALL: - may_use_call = true; + may_use_call = 1; break; case BLOCK_OP_CALL_PARM: @@ -1589,7 +1589,11 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method, break; case BLOCK_OP_NO_LIBCALL: - may_use_call = false; + may_use_call = 0; + break; + + case BLOCK_OP_NO_LIBCALL_RET: + may_use_call = -1; break; default: @@ -1625,6 +1629,9 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method, && ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (x)) && ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (y))) { + if (may_use_call < 0) + return pc_rtx; + /* Since x and y are passed to a libcall, mark the corresponding tree EXPR as addressable. */ tree y_expr = MEM_EXPR (y); |