public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/47790] New: [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x
@ 2011-02-18 0:08 pinskia at gcc dot gnu.org
2011-02-18 0:13 ` [Bug middle-end/47790] " pinskia at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-02-18 0:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47790
Summary: [4.5/4.6 Regression] optimize_bitfield_assignment_op
no longer works in 4.5.x
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pinskia@gcc.gnu.org
Created attachment 23391
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23391
Patch which needs testing but should fix it
Ever since expand-ssa was added optimize_bitfield_assignment_op no longer
works. You can see the difference in the code generated in
gcc.c-torture/execute/20040629-1.c.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/47790] [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x
2011-02-18 0:08 [Bug middle-end/47790] New: [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x pinskia at gcc dot gnu.org
@ 2011-02-18 0:13 ` pinskia at gcc dot gnu.org
2011-02-18 20:57 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-02-18 0:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47790
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
See Also| |http://gcc.gnu.org/bugzilla
| |/show_bug.cgi?id=18030,
| |http://gcc.gnu.org/bugzilla
| |/show_bug.cgi?id=18029
Target Milestone|--- |4.5.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/47790] [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x
2011-02-18 0:08 [Bug middle-end/47790] New: [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x pinskia at gcc dot gnu.org
2011-02-18 0:13 ` [Bug middle-end/47790] " pinskia at gcc dot gnu.org
@ 2011-02-18 20:57 ` pinskia at gcc dot gnu.org
2011-02-21 23:56 ` law at redhat dot com
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-02-18 20:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47790
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #23391|0 |1
is obsolete| |
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-02-18 20:47:55 UTC ---
Created attachment 23401
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23401
New patch which fixes one check dealing with code
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/47790] [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x
2011-02-18 0:08 [Bug middle-end/47790] New: [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x pinskia at gcc dot gnu.org
2011-02-18 0:13 ` [Bug middle-end/47790] " pinskia at gcc dot gnu.org
2011-02-18 20:57 ` pinskia at gcc dot gnu.org
@ 2011-02-21 23:56 ` law at redhat dot com
2011-02-22 17:38 ` law at redhat dot com
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: law at redhat dot com @ 2011-02-21 23:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47790
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.02.21 23:31:43
CC| |law at redhat dot com
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/47790] [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x
2011-02-18 0:08 [Bug middle-end/47790] New: [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x pinskia at gcc dot gnu.org
` (2 preceding siblings ...)
2011-02-21 23:56 ` law at redhat dot com
@ 2011-02-22 17:38 ` law at redhat dot com
2011-03-18 14:03 ` [Bug middle-end/47790] [4.5/4.6/4.7 " law at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: law at redhat dot com @ 2011-02-22 17:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47790
--- Comment #2 from Jeffrey A. Law <law at redhat dot com> 2011-02-22 17:09:36 UTC ---
A couple early comments.
First, it appears that it's never possible to get into this code via the old
path where SRC is a binary operation of some sort. This is presumably an
artifact of how we handle expansion.
If I understand your change correctly, you're walking the use-def chain when
SRC is an SSA_NAME in the hopes of finding a suitable binary operation to set
SRC. After that, you can just let the original code from
optimize_bitfield_assignment_op do its thing.
I found this fragment somewhat odd, what's its purpose?
+ if (TREE_CODE (op0) == SSA_NAME)
+ {
+ gimple op0stmt = get_gimple_for_ssa_name (op0);
+ if (!op0stmt || !is_gimple_assign (op0stmt) || gimple_assign_rhs_code
(op0stmt) != TREE_CODE (to) )
+ return false;
+ op0 = gimple_assign_rhs1 (op0stmt);
+ }
At this point OP0 is the RHS1 of the statement which set SRC via binary
operator.
Second, the original code stripped nops from OP0. Is there some reason you
don't do that? It probably doesn't matter, but you might be missing some
optimization opportunities as a result.
>From peeking at the testcase, if we could handle the case where SRC is a
typecast which is fed by a binary operation, we might have many more
opportunities to optimize. I guess that should be considered extra credit.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/47790] [4.5/4.6/4.7 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x
2011-02-18 0:08 [Bug middle-end/47790] New: [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x pinskia at gcc dot gnu.org
` (3 preceding siblings ...)
2011-02-22 17:38 ` law at redhat dot com
@ 2011-03-18 14:03 ` law at gcc dot gnu.org
2011-03-18 14:10 ` law at redhat dot com
2011-03-18 14:17 ` rguenth at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: law at gcc dot gnu.org @ 2011-03-18 14:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47790
--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> 2011-03-18 14:01:47 UTC ---
Author: law
Date: Fri Mar 18 14:01:41 2011
New Revision: 171139
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171139
Log:
PR middle-end/47790
* expr.c (optimize_bitfield_assignment_op): Revamp to work
again after expansion changes.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/expr.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/47790] [4.5/4.6/4.7 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x
2011-02-18 0:08 [Bug middle-end/47790] New: [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x pinskia at gcc dot gnu.org
` (4 preceding siblings ...)
2011-03-18 14:03 ` [Bug middle-end/47790] [4.5/4.6/4.7 " law at gcc dot gnu.org
@ 2011-03-18 14:10 ` law at redhat dot com
2011-03-18 14:17 ` rguenth at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: law at redhat dot com @ 2011-03-18 14:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47790
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #4 from Jeffrey A. Law <law at redhat dot com> 2011-03-18 14:03:00 UTC ---
Patch installed after minor formatting and comment tweaks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/47790] [4.5/4.6/4.7 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x
2011-02-18 0:08 [Bug middle-end/47790] New: [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x pinskia at gcc dot gnu.org
` (5 preceding siblings ...)
2011-03-18 14:10 ` law at redhat dot com
@ 2011-03-18 14:17 ` rguenth at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-18 14:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47790
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.5.3 |4.7.0
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-03-18 14:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-18 0:08 [Bug middle-end/47790] New: [4.5/4.6 Regression] optimize_bitfield_assignment_op no longer works in 4.5.x pinskia at gcc dot gnu.org
2011-02-18 0:13 ` [Bug middle-end/47790] " pinskia at gcc dot gnu.org
2011-02-18 20:57 ` pinskia at gcc dot gnu.org
2011-02-21 23:56 ` law at redhat dot com
2011-02-22 17:38 ` law at redhat dot com
2011-03-18 14:03 ` [Bug middle-end/47790] [4.5/4.6/4.7 " law at gcc dot gnu.org
2011-03-18 14:10 ` law at redhat dot com
2011-03-18 14:17 ` rguenth 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).