* [Bug target/50448] [avr] Missed optimization accessing struct component with known, absolute address.
2011-09-18 13:38 [Bug target/50448] New: [avr] Missed optimization accessing struct component with known, absolute address gjl at gcc dot gnu.org
@ 2011-09-18 13:41 ` gjl at gcc dot gnu.org
2011-09-29 16:00 ` [Bug middle-end/50448] [4.3/4.5/4.6/4.7 Regression] Missed optimization accessing struct component with integer address gjl at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-18 13:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50448
Georg-Johann Lay <gjl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-09-18
Target Milestone|--- |4.7.0
Ever Confirmed|0 |1
Known to fail| |4.3.3, 4.5.2, 4.6.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/50448] [4.3/4.5/4.6/4.7 Regression] Missed optimization accessing struct component with integer address
2011-09-18 13:38 [Bug target/50448] New: [avr] Missed optimization accessing struct component with known, absolute address gjl at gcc dot gnu.org
2011-09-18 13:41 ` [Bug target/50448] " gjl at gcc dot gnu.org
@ 2011-09-29 16:00 ` gjl at gcc dot gnu.org
2011-10-27 10:25 ` [Bug middle-end/50448] [4.5/4.6/4.7 " rguenth at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-29 16:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50448
Georg-Johann Lay <gjl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|target |middle-end
Known to work| |3.4.6
Summary|[avr] Missed optimization |[4.3/4.5/4.6/4.7
|accessing struct component |Regression] Missed
|with integer address |optimization accessing
| |struct component with
| |integer address
Known to fail| |4.7.0
--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-09-29 15:55:05 UTC ---
As explained in http://gcc.gnu.org/ml/gcc/2011-09/msg00353.html this looks like
a middle-end flaw during tree -> RTL lowering in
explow.c:memory_address_addr_space() where the target cannot do anything about.
Changed component from TARGET to MIDDLE-END.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/50448] [4.5/4.6/4.7 Regression] Missed optimization accessing struct component with integer address
2011-09-18 13:38 [Bug target/50448] New: [avr] Missed optimization accessing struct component with known, absolute address gjl at gcc dot gnu.org
2011-09-18 13:41 ` [Bug target/50448] " gjl at gcc dot gnu.org
2011-09-29 16:00 ` [Bug middle-end/50448] [4.3/4.5/4.6/4.7 Regression] Missed optimization accessing struct component with integer address gjl at gcc dot gnu.org
@ 2011-10-27 10:25 ` rguenth at gcc dot gnu.org
2011-10-28 13:00 ` gjl at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 10:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50448
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
Summary|[4.3/4.5/4.6/4.7 |[4.5/4.6/4.7 Regression]
|Regression] Missed |Missed optimization
|optimization accessing |accessing struct component
|struct component with |with integer address
|integer address |
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-27 10:24:56 UTC ---
Well, works "fine" on x86_64:
foo:
.LFB0:
.cfi_startproc
movb $-86, 2755
.L2:
movb 2754, %al
testb %al, %al
jns .L2
movl $2752, %eax
movb $-69, 3(%rax)
.L3:
movb 2754, %al
testb %al, %al
jns .L3
ret
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/50448] [4.5/4.6/4.7 Regression] Missed optimization accessing struct component with integer address
2011-09-18 13:38 [Bug target/50448] New: [avr] Missed optimization accessing struct component with known, absolute address gjl at gcc dot gnu.org
` (2 preceding siblings ...)
2011-10-27 10:25 ` [Bug middle-end/50448] [4.5/4.6/4.7 " rguenth at gcc dot gnu.org
@ 2011-10-28 13:00 ` gjl at gcc dot gnu.org
2011-10-28 14:27 ` bonzini at gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-10-28 13:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50448
Georg-Johann Lay <gjl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bonzini at gnu dot org
--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-10-28 12:59:28 UTC ---
The issue is still present for avr (4.7 trunk r180399).
There is a patch proposed by Paolo that fixes the issue:
Can someone of you integrate that patch? I have no access to compile farm and
cannot test for all languages/targets/hosts that might be affected.
Index: cprop.c
===================================================================
--- cprop.c (revision 177688)
+++ cprop.c (working copy)
@@ -764,6 +764,18 @@ try_replace_reg (rtx from, rtx to, rtx i
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}
+ if (set && MEM_P (SET_DEST (set)) && reg_mentioned_p (from, SET_DEST (set)))
+ {
+ /* If above failed and this is a single set, try to simplify the source
of
+ the set given our substitution. We could perhaps try this for multiple
+ SETs, but it probably won't buy us anything. */
+ rtx addr = simplify_replace_rtx (SET_DEST (set), from, to);
+
+ if (!rtx_equal_p (addr, SET_DEST (set))
+ && validate_change (insn, &SET_DEST (set), addr, 0))
+ success = 1;
+ }
+
/* REG_EQUAL may get simplified into register.
We don't allow that. Remove that note. This code ought
not to happen, because previous code ought to synthesize
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/50448] [4.5/4.6/4.7 Regression] Missed optimization accessing struct component with integer address
2011-09-18 13:38 [Bug target/50448] New: [avr] Missed optimization accessing struct component with known, absolute address gjl at gcc dot gnu.org
` (3 preceding siblings ...)
2011-10-28 13:00 ` gjl at gcc dot gnu.org
@ 2011-10-28 14:27 ` bonzini at gnu dot org
2011-11-03 11:02 ` [Bug rtl-optimization/50448] " gjl at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bonzini at gnu dot org @ 2011-10-28 14:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50448
--- Comment #4 from Paolo Bonzini <bonzini at gnu dot org> 2011-10-28 14:26:57 UTC ---
Can't you just test on x86_64-linux?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/50448] [4.5/4.6/4.7 Regression] Missed optimization accessing struct component with integer address
2011-09-18 13:38 [Bug target/50448] New: [avr] Missed optimization accessing struct component with known, absolute address gjl at gcc dot gnu.org
` (4 preceding siblings ...)
2011-10-28 14:27 ` bonzini at gnu dot org
@ 2011-11-03 11:02 ` gjl at gcc dot gnu.org
2011-11-05 13:09 ` gjl at gcc dot gnu.org
2011-11-05 20:37 ` gjl at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-11-03 11:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50448
--- Comment #5 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-11-03 11:01:55 UTC ---
(In reply to comment #0)
> foo:
> ldi r24,lo8(-86)
> ldi r30,lo8(2752)
> ldi r31,hi8(2752)
> std Z+3,r24
> .L2:
> lds r24,2754
> sbrs r24,7
> rjmp .L2
> ldi r24,lo8(-69)
> ldi r30,lo8(2752)
> ldi r31,hi8(2752)
> std Z+3,r24
> [...]
This is the code generated with Paolo's patch applied:
foo:
ldi r24,lo8(-86)
sts 2755,r24
.L2:
lds r24,2754
sbrs r24,7
rjmp .L2
ldi r24,lo8(-69)
sts 2755,r24
[...]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/50448] [4.5/4.6/4.7 Regression] Missed optimization accessing struct component with integer address
2011-09-18 13:38 [Bug target/50448] New: [avr] Missed optimization accessing struct component with known, absolute address gjl at gcc dot gnu.org
` (5 preceding siblings ...)
2011-11-03 11:02 ` [Bug rtl-optimization/50448] " gjl at gcc dot gnu.org
@ 2011-11-05 13:09 ` gjl at gcc dot gnu.org
2011-11-05 20:37 ` gjl at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-11-05 13:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50448
--- Comment #6 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-11-05 13:08:57 UTC ---
Author: gjl
Date: Sat Nov 5 13:08:54 2011
New Revision: 181011
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181011
Log:
PR rtl-optimization/50448
* cprop.c (try_replace_reg): Also try to replace uses of FROM that
appear in SET_DEST.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cprop.c
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug rtl-optimization/50448] [4.5/4.6/4.7 Regression] Missed optimization accessing struct component with integer address
2011-09-18 13:38 [Bug target/50448] New: [avr] Missed optimization accessing struct component with known, absolute address gjl at gcc dot gnu.org
` (6 preceding siblings ...)
2011-11-05 13:09 ` gjl at gcc dot gnu.org
@ 2011-11-05 20:37 ` gjl at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-11-05 20:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50448
Georg-Johann Lay <gjl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-11-05 20:37:25 UTC ---
Fixed in 4.7.0
^ permalink raw reply [flat|nested] 9+ messages in thread