[Bug middle-end/22141] [4.0/4.1 Regression] Missing optimization when storing structures
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Jun 22 13:07:00 GMT 2005
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-22 13:07 -------
Reduced testcase for the regression:
typedef struct type
{
char a;
char b;
char c;
char d;
} type_t;
type_t u;
void
f(void)
{
u = (type_t){ 1, 2, 3, 4};
}
3.3 produced:
lis r0,0x102
lis r2,ha16(_u)
ori r0,r0,772
stw r0,lo16(_u)(r2)
blr
4.0.0 produces:
lis r11,ha16(_u)
li r0,2
la r9,lo16(_u)(r11)
li r2,1
stb r0,1(r9)
li r0,4
stb r2,lo16(_u)(r11)
li r2,3
stb r0,3(r9)
stb r2,2(r9)
blr
Which is much slower and larger.
Also this is a code size regression even at -Os.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c |middle-end
Ever Confirmed| |1
Keywords| |missed-optimization
Last reconfirmed|0000-00-00 00:00:00 |2005-06-22 13:07:06
date| |
Summary|Missing optimization when |[4.0/4.1 Regression] Missing
|storing structures |optimization when storing
| |structures
Target Milestone|--- |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22141
More information about the Gcc-bugs
mailing list