public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
@ 2015-01-08 14:16 vries at gcc dot gnu.org
2015-01-08 14:23 ` [Bug rtl-optimization/64539] " vries at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2015-01-08 14:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
Bug ID: 64539
Summary: [5 regression] cprop_hardreg does not respect clobbers
in C_I_F_U
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: vries at gcc dot gnu.org
As discussed in PR64154 comment 2 and 3, the clobbers in
CALL_INSN_FUNCTION_USAGE are in general not registered by
copyprop_hardreg_forward_1.
F.i. in this thumb1 call insn there's a clobber of the ip reg, that is ignored
by cprop_hardreg:
...
(call_insn 141 292 142 13 (parallel [
(call (mem:SI (symbol_ref:SI ("f2") [flags 0x3] <function_decl
0x7f8182689100 f2>) [0 f2 S4 A32])
(const_int 0 [0]))
(use (const_int 0 [0]))
(clobber (reg:SI 14 lr))
])
/myssd/terguo01/toolchain-build/GCC32RM-424/src/gcc/gcc/testsuite/gcc.dg/vshift-3.c:119
770 {*call_insn}
(expr_list:REG_CALL_DECL (symbol_ref:SI ("f2") [flags 0x3] <function_decl
0x7f8182689100 f2>)
(expr_list:REG_EH_REGION (const_int 0 [0])
(nil)))
(expr_list (clobber (reg:SI 12 ip))
(nil)))
...
I can't rule out that this is a generic bug, so marking tentatively as 5.0
regression.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/64539] [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
@ 2015-01-08 14:23 ` vries at gcc dot gnu.org
2015-01-08 17:38 ` vries at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2015-01-08 14:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
--- Comment #1 from vries at gcc dot gnu.org ---
In order to fix this, I'll probably first have to understand the PR57003 issue
and fix.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/64539] [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
2015-01-08 14:23 ` [Bug rtl-optimization/64539] " vries at gcc dot gnu.org
@ 2015-01-08 17:38 ` vries at gcc dot gnu.org
2015-01-09 8:32 ` vries at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2015-01-08 17:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
--- Comment #2 from vries at gcc dot gnu.org ---
At first glance, this seems appropriate:
...
diff --git a/gcc/regcprop.c b/gcc/regcprop.c
index 8c4f564..b42a4b7 100644
--- a/gcc/regcprop.c
+++ b/gcc/regcprop.c
@@ -801,6 +801,18 @@ copyprop_hardreg_forward_1 (basic_block bb, struct
value_data *vd)
I wouldn't think this were true for regular insns, but
scan_rtx treats them like that... */
note_stores (PATTERN (insn), kill_clobbered_value, vd);
+ if (CALL_P (insn))
+ {
+ rtx exp;
+ for (exp = CALL_INSN_FUNCTION_USAGE (insn);
+ exp;
+ exp = XEXP (exp, 1))
+ {
+ rtx x = XEXP (exp, 0);
+ if (GET_CODE (x) == CLOBBER)
+ kill_value (SET_DEST (x), vd);
+ }
+ }
/* Kill all auto-incremented values. */
/* ??? REG_INC is useless, since stack pushes aren't done that way. */
...
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/64539] [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
2015-01-08 14:23 ` [Bug rtl-optimization/64539] " vries at gcc dot gnu.org
2015-01-08 17:38 ` vries at gcc dot gnu.org
@ 2015-01-09 8:32 ` vries at gcc dot gnu.org
2015-01-09 8:38 ` vries at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2015-01-09 8:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
--- Comment #3 from vries at gcc dot gnu.org ---
Created attachment 34411
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34411&action=edit
Tentative patch
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/64539] [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
` (2 preceding siblings ...)
2015-01-09 8:32 ` vries at gcc dot gnu.org
@ 2015-01-09 8:38 ` vries at gcc dot gnu.org
2015-01-09 8:49 ` terry.guo at arm dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2015-01-09 8:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
vries at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |terry.guo at arm dot com
--- Comment #4 from vries at gcc dot gnu.org ---
Hi Terry,
I've bootstrapped and reg-tested the patch from comment 3 on x86_64, no issues
found.
Can you try the patch, and see if it fixes the problem that you observed in
PR64154 comment 2 ?
Thanks,
- Tom
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/64539] [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
` (3 preceding siblings ...)
2015-01-09 8:38 ` vries at gcc dot gnu.org
@ 2015-01-09 8:49 ` terry.guo at arm dot com
2015-01-09 10:58 ` vries at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: terry.guo at arm dot com @ 2015-01-09 8:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
--- Comment #5 from Terry Guo <terry.guo at arm dot com> ---
Thanks and it did fixed the issue I observed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/64539] [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
` (4 preceding siblings ...)
2015-01-09 8:49 ` terry.guo at arm dot com
@ 2015-01-09 10:58 ` vries at gcc dot gnu.org
2015-01-09 11:20 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2015-01-09 10:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
vries at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch, wrong-code
--- Comment #6 from vries at gcc dot gnu.org ---
https://gcc.gnu.org/ml/gcc-patches/2015-01/msg00477.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/64539] [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
` (5 preceding siblings ...)
2015-01-09 10:58 ` vries at gcc dot gnu.org
@ 2015-01-09 11:20 ` rguenth at gcc dot gnu.org
2015-01-09 18:55 ` vries at gcc dot gnu.org
2015-01-09 19:02 ` vries at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-09 11:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |5.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/64539] [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
` (6 preceding siblings ...)
2015-01-09 11:20 ` rguenth at gcc dot gnu.org
@ 2015-01-09 18:55 ` vries at gcc dot gnu.org
2015-01-09 19:02 ` vries at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2015-01-09 18:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
--- Comment #7 from vries at gcc dot gnu.org ---
Author: vries
Date: Fri Jan 9 18:54:20 2015
New Revision: 219400
URL: https://gcc.gnu.org/viewcvs?rev=219400&root=gcc&view=rev
Log:
Handle CALL_INSN_FUNCTION_USAGE clobbers in regcprop.c
2015-01-09 Tom de Vries <tom@codesourcery.com>
PR rtl-optimization/64539
* regcprop.c (kill_clobbered_values): Factor out of ...
(copyprop_hardreg_forward_1): ... here. Use kill_clobbered_values
instead of note_stores with kill_clobbered_value.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/regcprop.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug rtl-optimization/64539] [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
` (7 preceding siblings ...)
2015-01-09 18:55 ` vries at gcc dot gnu.org
@ 2015-01-09 19:02 ` vries at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2015-01-09 19:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64539
vries at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from vries at gcc dot gnu.org ---
Patch committed, marking resolved-fixed.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-01-09 19:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08 14:16 [Bug rtl-optimization/64539] New: [5 regression] cprop_hardreg does not respect clobbers in C_I_F_U vries at gcc dot gnu.org
2015-01-08 14:23 ` [Bug rtl-optimization/64539] " vries at gcc dot gnu.org
2015-01-08 17:38 ` vries at gcc dot gnu.org
2015-01-09 8:32 ` vries at gcc dot gnu.org
2015-01-09 8:38 ` vries at gcc dot gnu.org
2015-01-09 8:49 ` terry.guo at arm dot com
2015-01-09 10:58 ` vries at gcc dot gnu.org
2015-01-09 11:20 ` rguenth at gcc dot gnu.org
2015-01-09 18:55 ` vries at gcc dot gnu.org
2015-01-09 19:02 ` vries at gcc dot gnu.org
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).