* [PATCH] Comparison with an enum should mention enum value.
@ 2018-11-30 9:49 Martin Liška
2018-11-30 23:16 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2018-11-30 9:49 UTC (permalink / raw)
To: gcc-patches; +Cc: Jeff Law
[-- Attachment #1: Type: text/plain, Size: 512 bytes --]
Hi.
This is one more clean up of the transition that I've just tested
on x86_64-linux-gnu.
I'm planning to install it once I'll come back from vacation (27/12).
Thanks,
Martin
gcc/ChangeLog:
2018-11-29 Martin Liska <mliska@suse.cz>
* builtins.c (expand_movstr): Compare with RETURN_BEGIN.
* expr.c (move_by_pieces): Likewise.
(store_by_pieces): Likewise.
(store_expr): Fix GNU coding style.
---
gcc/builtins.c | 3 ++-
gcc/expr.c | 8 ++++----
2 files changed, 6 insertions(+), 5 deletions(-)
[-- Attachment #2: 0001-Comparison-with-an-enum-should-mention-enum-value.patch --]
[-- Type: text/x-patch, Size: 1803 bytes --]
diff --git a/gcc/builtins.c b/gcc/builtins.c
index dcac49d8be1..5728ee0e86e 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -3937,7 +3937,8 @@ expand_movstr (tree dest, tree src, rtx target, memop_ret retmode)
dest_mem = replace_equiv_address (dest_mem, target);
}
- create_output_operand (&ops[0], retmode ? target : NULL_RTX, Pmode);
+ create_output_operand (&ops[0],
+ retmode != RETURN_BEGIN ? target : NULL_RTX, Pmode);
create_fixed_operand (&ops[1], dest_mem);
create_fixed_operand (&ops[2], src_mem);
if (!maybe_expand_insn (targetm.code_for_movstr, 3, ops))
diff --git a/gcc/expr.c b/gcc/expr.c
index 85b7847431b..43b129ce5b1 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1220,7 +1220,7 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
data.run ();
- if (retmode)
+ if (retmode != RETURN_BEGIN)
return data.finish_retmode (retmode);
else
return to;
@@ -1388,7 +1388,7 @@ store_by_pieces (rtx to, unsigned HOST_WIDE_INT len,
store_by_pieces_d data (to, constfun, constfundata, len, align);
data.run ();
- if (retmode)
+ if (retmode != RETURN_BEGIN)
return data.finish_retmode (retmode);
else
return to;
@@ -5609,13 +5609,13 @@ store_expr (tree exp, rtx target, int call_param_p,
dest_mem = target;
+ memop_ret retmode = exp_len > str_copy_len ? RETURN_END : RETURN_BEGIN;
dest_mem = store_by_pieces (dest_mem,
str_copy_len, builtin_strncpy_read_str,
CONST_CAST (char *,
TREE_STRING_POINTER (str)),
MEM_ALIGN (target), false,
- (exp_len > str_copy_len ? RETURN_END :
- RETURN_BEGIN));
+ retmode);
if (exp_len > str_copy_len)
clear_storage (adjust_address (dest_mem, BLKmode, 0),
GEN_INT (exp_len - str_copy_len),
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Comparison with an enum should mention enum value.
2018-11-30 9:49 [PATCH] Comparison with an enum should mention enum value Martin Liška
@ 2018-11-30 23:16 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2018-11-30 23:16 UTC (permalink / raw)
To: Martin Liška, gcc-patches
On 11/30/18 2:49 AM, Martin Liška wrote:
> Hi.
>
> This is one more clean up of the transition that I've just tested
> on x86_64-linux-gnu.
>
> I'm planning to install it once I'll come back from vacation (27/12).
>
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2018-11-29 Martin Liska <mliska@suse.cz>
>
> * builtins.c (expand_movstr): Compare with RETURN_BEGIN.
> * expr.c (move_by_pieces): Likewise.
> (store_by_pieces): Likewise.
> (store_expr): Fix GNU coding style.
OK
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-30 23:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-30 9:49 [PATCH] Comparison with an enum should mention enum value Martin Liška
2018-11-30 23:16 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).