* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
@ 2007-07-24 23:50 ` eweddington at cso dot atmel dot com
2007-07-27 1:24 ` dmixm at marine dot febras dot ru
` (19 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-07-24 23:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from eweddington at cso dot atmel dot com 2007-07-24 23:50 -------
Version 4.2.1 offers somewhat better results:
With -O0:
.file "test.c"
/* File "test.c": code 109 = 0x006d ( 74), prologues 18, epilogues 17 */
With -O[123s]:
.file "test.c"
/* File "test.c": code 79 = 0x004f ( 28), prologues 26, epilogues 25 */
At least the code no longer increases in size when optimization is turned on.
Dmitry, are the results for 4.2.1 acceptable for this bug report?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
2007-07-24 23:50 ` [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment eweddington at cso dot atmel dot com
@ 2007-07-27 1:24 ` dmixm at marine dot febras dot ru
2007-07-27 14:23 ` eweddington at cso dot atmel dot com
` (18 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: dmixm at marine dot febras dot ru @ 2007-07-27 1:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from dmixm at marine dot febras dot ru 2007-07-27 01:24 -------
Yes, results are:
avr-gcc-3.3.6: O0 --> 75, O1,O2,O3,Os --> 79
avr-gcc-4.2.1: O0 --> 109, O1,O2,O3,Os --> 79
The mistake is corrected? It is possible to tell and so as now
application of keys of optimization shortens a code. However,
"correction" does not improve quality of optimization, it only worsens
not optimized code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
2007-07-24 23:50 ` [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment eweddington at cso dot atmel dot com
2007-07-27 1:24 ` dmixm at marine dot febras dot ru
@ 2007-07-27 14:23 ` eweddington at cso dot atmel dot com
2007-09-09 21:59 ` dmixm at marine dot febras dot ru
` (17 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-07-27 14:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from eweddington at cso dot atmel dot com 2007-07-27 14:23 -------
Subject: RE: [avr-gcc] Optimization decrease performance of
struct assignment.
> ------- Comment #10 from dmixm at marine dot febras dot ru
> 2007-07-27 01:24 -------
> Yes, results are:
>
> avr-gcc-3.3.6: O0 --> 75, O1,O2,O3,Os --> 79
> avr-gcc-4.2.1: O0 --> 109, O1,O2,O3,Os --> 79
>
> The mistake is corrected? It is possible to tell and so as now
> application of keys of optimization shortens a code. However,
> "correction" does not improve quality of optimization, it only worsens
> not optimized code.
Agreed. But is this sufficient to close this bug report?
Eric
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2007-07-27 14:23 ` eweddington at cso dot atmel dot com
@ 2007-09-09 21:59 ` dmixm at marine dot febras dot ru
2007-09-11 16:11 ` eweddington at cso dot atmel dot com
` (16 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: dmixm at marine dot febras dot ru @ 2007-09-09 21:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from dmixm at marine dot febras dot ru 2007-09-09 21:59 -------
Andy Hutchinson wrote (comment #6) that addition a 'movdi' instruction improves
the result. I have try to add a very simple 'movdi' (which split into 2 SImode
instuctions). In result:
-O0 --> 85 words,
-O1,2,3,s --> 50 words.
Version is 4.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2007-09-09 21:59 ` dmixm at marine dot febras dot ru
@ 2007-09-11 16:11 ` eweddington at cso dot atmel dot com
2007-09-16 3:22 ` dmixm at marine dot febras dot ru
` (15 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-09-11 16:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from eweddington at cso dot atmel dot com 2007-09-11 16:10 -------
(In reply to comment #12)
> Andy Hutchinson wrote (comment #6) that addition a 'movdi' instruction improves
> the result. I have try to add a very simple 'movdi' (which split into 2 SImode
> instuctions). In result:
> -O0 --> 85 words,
> -O1,2,3,s --> 50 words.
> Version is 4.2.1
>
That's great! Dmitry, could you attach your patch?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2007-09-11 16:11 ` eweddington at cso dot atmel dot com
@ 2007-09-16 3:22 ` dmixm at marine dot febras dot ru
2007-09-16 12:57 ` rask at gcc dot gnu dot org
` (14 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: dmixm at marine dot febras dot ru @ 2007-09-16 3:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from dmixm at marine dot febras dot ru 2007-09-16 03:22 -------
It was:
(define_insn "movdi"
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(match_operand:DI 1 "general_operand" ""))]
""
"#")
(define_split
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(match_operand:DI 1 "general_operand" ""))]
"reload_completed"
[(set (match_dup 2) (match_dup 4))
(set (match_dup 3) (match_dup 5))]
"{
operands[2] = simplify_gen_subreg (SImode, operands[0], DImode, 0);
operands[3] = simplify_gen_subreg (SImode, operands[0], DImode, 4);
operands[4] = simplify_gen_subreg (SImode, operands[1], DImode, 0);
operands[5] = simplify_gen_subreg (SImode, operands[1], DImode, 4);
}")
Alas, this elementary addition has appeared erroneous.
The following program leads to emergency end of compilation:
int main ()
{
volatile long long x = 0x0102030405060708LL;
if (x != 0x0102030405060708LL)
exit (__LINE__);
exit (0);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2007-09-16 3:22 ` dmixm at marine dot febras dot ru
@ 2007-09-16 12:57 ` rask at gcc dot gnu dot org
2007-09-16 13:38 ` rask at gcc dot gnu dot org
` (13 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: rask at gcc dot gnu dot org @ 2007-09-16 12:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from rask at gcc dot gnu dot org 2007-09-16 12:57 -------
1. You should use define_insn_and_split.
2. If possible (which I think it is here), splitting before reload should
produc.e better code.
Btw, what is the ICE?
Also, it seems to me that avr.h defines MOVE_MAX incorrectly. Shouldn't it be 2
instead of 4?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2007-09-16 12:57 ` rask at gcc dot gnu dot org
@ 2007-09-16 13:38 ` rask at gcc dot gnu dot org
2007-09-16 13:54 ` rask at gcc dot gnu dot org
` (12 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: rask at gcc dot gnu dot org @ 2007-09-16 13:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from rask at gcc dot gnu dot org 2007-09-16 13:38 -------
Created an attachment (id=14211)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14211&action=view)
quick and dirty patch to reduce code size
A fundamental problem with the AVR back end is that it sabotages the RTL
optimizer's attempts to optimize away redundant move insns. With this patch, I
get better code (-O2):
foo:
push r29 ; 73 *pushhi/1 [length = 2]
push r28
rcall . ; 79 *addhi3_sp_R_pc2 [length = 3]
rcall .
rcall .
in r28,__SP_L__ ; 90 *movqi/6 [length = 1]
in r29,__SP_H__ ; 91 *movqi/6 [length = 1]
/* prologue: function */
/* frame size = 6 */
ldi r24,lo8(2) ; 68 *movqi/2 [length = 1]
std Y+5,r24 ; 70 *movqi/3 [length = 1]
std Y+6,__zero_reg__ ; 71 *movqi/3 [length = 1]
ldi r22,lo8(2) ; 21 *movqi/2 [length = 1]
ldi r23,lo8(0) ; 23 *movqi/2 [length = 1]
ldi r18,lo8(1) ; 42 *movqi/2 [length = 1]
ldi r19,lo8(0) ; 43 *movqi/2 [length = 1]
ldi r20,lo8(0) ; 44 *movqi/2 [length = 1]
ldi r21,lo8(0) ; 45 *movqi/2 [length = 1]
ldi r24,lo8(0) ; 48 *movqi/2 [length = 1]
ldi r25,lo8(0) ; 49 *movqi/2 [length = 1]
/* epilogue start */
adiw r28,6 ; 85 *addhi3/2 [length = 1]
out __SP_L__,r28 ; 92 *movqi/5 [length = 1]
out __SP_H__,r29 ; 93 *movqi/5 [length = 1]
pop r28 ; 87 pophi [length = 2]
pop r29
ret ; 88 return_from_epilogue [length = 1]
.size foo, .-foo
/* File "/home/rask/pr11180.c": code 0 = 0x0000 ( 0), prologues 0,
epilogues 0 */
Perhaps a peephole optimization could replace insns 48 and 49 with "movw
r25:r24, r21:r20".
The only big further improvement I see would be to get rid of the stack var.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (7 preceding siblings ...)
2007-09-16 13:38 ` rask at gcc dot gnu dot org
@ 2007-09-16 13:54 ` rask at gcc dot gnu dot org
2007-09-16 15:44 ` eweddington at cso dot atmel dot com
` (11 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: rask at gcc dot gnu dot org @ 2007-09-16 13:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #17 from rask at gcc dot gnu dot org 2007-09-16 13:54 -------
The patch is against mainline revision 128431.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (8 preceding siblings ...)
2007-09-16 13:54 ` rask at gcc dot gnu dot org
@ 2007-09-16 15:44 ` eweddington at cso dot atmel dot com
2007-09-16 17:30 ` rask at gcc dot gnu dot org
` (10 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-09-16 15:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #18 from eweddington at cso dot atmel dot com 2007-09-16 15:44 -------
Subject: RE: [avr-gcc] Optimization decrease performance of
struct assignment.
> ------- Comment #15 from rask at gcc dot gnu dot org
> 2007-09-16 12:57 -------
> Also, it seems to me that avr.h defines MOVE_MAX incorrectly.
> Shouldn't it be 2
> instead of 4?
Hmm. Yes and no. There are variants that have the MOVW instruction, and for
those it should be 2. Otherwise, if they don't have the MOVW instruction, it
should be 1, I think.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (9 preceding siblings ...)
2007-09-16 15:44 ` eweddington at cso dot atmel dot com
@ 2007-09-16 17:30 ` rask at gcc dot gnu dot org
2007-09-17 2:32 ` eweddington at cso dot atmel dot com
` (9 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: rask at gcc dot gnu dot org @ 2007-09-16 17:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #19 from rask at gcc dot gnu dot org 2007-09-16 17:30 -------
Created an attachment (id=14213)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14213&action=view)
quick and dirty patch to reduce code size
Here's a patch which doesn't mess up the stack pointer update in the epilogue.
The code size output is broken on mainline, so here's what I use:
$ gcc/xgcc -Bgcc/ -W -Wall ~/pr11180.c -S -dp -o /dev/stdout -O2 | awk
'match($0, /\[length = ([[:digit:]]+)\]/, field) { sum += field[1]; } END {
print sum; }'
27
Compare that to unpatched mainline:
$ gcc/xgcc -Bgcc/ -W -Wall ~/pr11180.c -S -dp -o /dev/stdout -O2 | awk
'match($0, /\[length = ([[:digit:]]+)\]/, field) { sum += field[1]; } END {
print sum; }'
36
--
rask at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #14211|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (10 preceding siblings ...)
2007-09-16 17:30 ` rask at gcc dot gnu dot org
@ 2007-09-17 2:32 ` eweddington at cso dot atmel dot com
2007-09-17 11:13 ` rask at gcc dot gnu dot org
` (8 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-09-17 2:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #20 from eweddington at cso dot atmel dot com 2007-09-17 02:31 -------
Subject: RE: [avr-gcc] Optimization decrease performance of
struct assignment.
> Here's a patch which doesn't mess up the stack pointer update
> in the epilogue.
>
Hi Rask,
Your patch causes a regression. Sort of.
I have a small patch that enables Objective-C for the AVR (not that anyone
would or should use it), that hasn't been committed yet:
--- gcc/config/avr/avr.h.old 2007-08-23 15:18:31.015625000 -0600
+++ gcc/config/avr/avr.h 2007-08-23 15:19:17.687500000 -0600
@@ -53,7 +53,7 @@ extern int avr_mega_p;
extern int avr_have_mul_p;
extern int avr_asm_only_p;
extern int avr_have_movw_lpmx_p;
-#ifndef IN_LIBGCC2
+#if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS)
extern GTY(()) section *progmem_section;
#endif
Well, your patch causes a new error in configuring libobjc (when using the
patch above):
checking for thread model used by GCC... single
checking for exception model to use... configure: error: unable to detect
exception model
make[1]: *** [configure-target-libobjc] Error 1
make[1]: Leaving directory `/c/avrdev/gcc/build'
make: *** [all] Error 2
Normally, configure detects the exception model as sjlj.
The portion of your patch that changes MOVE_MAX in avr.h is fine. The
problem seems to be something with your changes in avr.md.
Why this is happening, I don't really know. I'm certainly more concerned
with optimizing the C compiler than I am in having ObjC build.
Thanks,
Eric Weddington
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (11 preceding siblings ...)
2007-09-17 2:32 ` eweddington at cso dot atmel dot com
@ 2007-09-17 11:13 ` rask at gcc dot gnu dot org
2007-09-17 22:53 ` eweddington at cso dot atmel dot com
` (7 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: rask at gcc dot gnu dot org @ 2007-09-17 11:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #21 from rask at gcc dot gnu dot org 2007-09-17 11:13 -------
It's probably someting simple, see config.log. Like I said, the patch is a
quick and dirty one and the AVR back end can use more work than that, most of
which means deleting patterns. Examples: All and, ior, xor, one_cmpl and sign
extend patterns larger than qimode, all zero_extend patterns, all movsi, movdi
and such. Along with that all the output_xxx functions in avr.c that they use.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (12 preceding siblings ...)
2007-09-17 11:13 ` rask at gcc dot gnu dot org
@ 2007-09-17 22:53 ` eweddington at cso dot atmel dot com
2007-09-18 7:14 ` rask at gcc dot gnu dot org
` (6 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-09-17 22:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #22 from eweddington at cso dot atmel dot com 2007-09-17 22:53 -------
Subject: RE: [avr-gcc] Optimization decrease performance of
struct assignment.
> ------- Comment #21 from rask at gcc dot gnu dot org
> 2007-09-17 11:13 -------
> It's probably someting simple, see config.log.
Here it is:
configure:10398: error: unrecognizable insn:
(insn 105 104 106 2 (set (subreg:QI (reg/f:HI 52) 0)
(subreg:QI (label_ref:HI 57) 0)) -1 (nil))
configure:10398: internal compiler error: in extract_insn, at recog.c:1990
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (13 preceding siblings ...)
2007-09-17 22:53 ` eweddington at cso dot atmel dot com
@ 2007-09-18 7:14 ` rask at gcc dot gnu dot org
2007-09-18 19:06 ` eweddington at cso dot atmel dot com
` (5 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: rask at gcc dot gnu dot org @ 2007-09-18 7:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #23 from rask at gcc dot gnu dot org 2007-09-18 07:14 -------
> configure:10398: error: unrecognizable insn:
> (insn 105 104 106 2 (set (subreg:QI (reg/f:HI 52) 0)
> (subreg:QI (label_ref:HI 57) 0)) -1 (nil))
> configure:10398: internal compiler error: in extract_insn, at recog.c:1990
In define_insn_and_split "*movhi", add the line
&& LABEL_REF != GET_CODE (operands[1])
where it already says
&& SYMBOL_REF != GET_CODE (operands[1])
and the error should go away.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (14 preceding siblings ...)
2007-09-18 7:14 ` rask at gcc dot gnu dot org
@ 2007-09-18 19:06 ` eweddington at cso dot atmel dot com
2007-09-18 19:49 ` rask at gcc dot gnu dot org
` (4 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-09-18 19:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #24 from eweddington at cso dot atmel dot com 2007-09-18 19:06 -------
Subject: RE: [avr-gcc] Optimization decrease performance of
struct assignment.
> ------- Comment #23 from rask at gcc dot gnu dot org
>
> In define_insn_and_split "*movhi", add the line
>
> && LABEL_REF != GET_CODE (operands[1])
>
> where it already says
>
> && SYMBOL_REF != GET_CODE (operands[1])
>
> and the error should go away.
I *added* the line (not replace) as you suggested, and now it generates a
new error during build:
c:/avrdev/gcc/gcc-4.3-20070914/libobjc/Object.m:66: error: unrecognizable
insn:
(insn 54 4 55 2 c:/avrdev/gcc/gcc-4.3-20070914/libobjc/Object.m:65 (set
(reg:QI 22 r22 [ D.2345 ])
(subreg:QI (const:HI (plus:HI (symbol_ref:HI
("_OBJC_SELECTOR_TABLE") [flags 0x2] <var_decl 013C4A20
_OBJC_SELECTOR_TABLE>)
(const_int 8 [0x8]))) 0)) -1 (nil))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (15 preceding siblings ...)
2007-09-18 19:06 ` eweddington at cso dot atmel dot com
@ 2007-09-18 19:49 ` rask at gcc dot gnu dot org
2007-09-19 5:28 ` eweddington at cso dot atmel dot com
` (3 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: rask at gcc dot gnu dot org @ 2007-09-18 19:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #25 from rask at gcc dot gnu dot org 2007-09-18 19:49 -------
> c:/avrdev/gcc/gcc-4.3-20070914/libobjc/Object.m:66: error: unrecognizable
> insn:
> (insn 54 4 55 2 c:/avrdev/gcc/gcc-4.3-20070914/libobjc/Object.m:65 (set
> (reg:QI 22 r22 [ D.2345 ])
> (subreg:QI (const:HI (plus:HI (symbol_ref:HI
> ("_OBJC_SELECTOR_TABLE") [flags 0x2] <var_decl 013C4A20
> _OBJC_SELECTOR_TABLE>)
> (const_int 8 [0x8]))) 0)) -1 (nil))
That's a similar story: Add a line with
&& CONST != GET_CODE (operands[1])
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (16 preceding siblings ...)
2007-09-18 19:49 ` rask at gcc dot gnu dot org
@ 2007-09-19 5:28 ` eweddington at cso dot atmel dot com
2007-09-19 17:58 ` eweddington at cso dot atmel dot com
` (2 subsequent siblings)
20 siblings, 0 replies; 28+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-09-19 5:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #26 from eweddington at cso dot atmel dot com 2007-09-19 05:28 -------
Subject: RE: [avr-gcc] Optimization decrease performance of
struct assignment.
> > c:/avrdev/gcc/gcc-4.3-20070914/libobjc/Object.m:66: error:
> unrecognizable
> > insn:
> > (insn 54 4 55 2
> c:/avrdev/gcc/gcc-4.3-20070914/libobjc/Object.m:65 (set
> > (reg:QI 22 r22 [ D.2345 ])
> > (subreg:QI (const:HI (plus:HI (symbol_ref:HI
> > ("_OBJC_SELECTOR_TABLE") [flags 0x2] <var_decl 013C4A20
> > _OBJC_SELECTOR_TABLE>)
> > (const_int 8 [0x8]))) 0)) -1 (nil))
>
> That's a similar story: Add a line with
> && CONST != GET_CODE (operands[1])
That finally did the trick! At least it builds now...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (17 preceding siblings ...)
2007-09-19 5:28 ` eweddington at cso dot atmel dot com
@ 2007-09-19 17:58 ` eweddington at cso dot atmel dot com
2008-02-02 15:45 ` hutchinsonandy at aim dot com
2008-02-19 2:47 ` eric dot weddington at atmel dot com
20 siblings, 0 replies; 28+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-09-19 17:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #27 from eweddington at cso dot atmel dot com 2007-09-19 17:57 -------
Created an attachment (id=14224)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14224&action=view)
Rask's patch modified from comments.
Here is Rask's patch again, but slightly modified from the comments.
--
eweddington at cso dot atmel dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #14213|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (18 preceding siblings ...)
2007-09-19 17:58 ` eweddington at cso dot atmel dot com
@ 2008-02-02 15:45 ` hutchinsonandy at aim dot com
2008-02-19 2:47 ` eric dot weddington at atmel dot com
20 siblings, 0 replies; 28+ messages in thread
From: hutchinsonandy at aim dot com @ 2008-02-02 15:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #28 from hutchinsonandy at aim dot com 2008-02-02 15:44 -------
The patch and suggestions on this are valid. However, memory moves -
particular with base pointers, may require additional instruction to be added
to reach required displacments. Splitting such moves may well incur the
overhead per BYTE!
So we need to get the pointers sorted so that (for example) 4 separate QI bytes
is just as good as 1 access to 4 SI bytes.
As for other pattern removal YES!
The reason to change MOVE_MAX is not made clear. I understood this to control
the threshold for using movmem rather than inline RTL. movmem wins (in size) at
about 8+ bytes. Does it have another use related to this problem?
--
hutchinsonandy at aim dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hutchinsonandy at aim dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread
* [Bug target/11180] [avr-gcc] Optimization decrease performance of struct assignment.
[not found] <bug-11180-6291@http.gcc.gnu.org/bugzilla/>
` (19 preceding siblings ...)
2008-02-02 15:45 ` hutchinsonandy at aim dot com
@ 2008-02-19 2:47 ` eric dot weddington at atmel dot com
20 siblings, 0 replies; 28+ messages in thread
From: eric dot weddington at atmel dot com @ 2008-02-19 2:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #29 from eric dot weddington at atmel dot com 2008-02-19 02:47 -------
Rask's patch (gcc-4.3-bug-11180-experimental.patch) causes worse code for the
test case in bug #32871, than without the patch.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11180
^ permalink raw reply [flat|nested] 28+ messages in thread