http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52530
Uros Bizjak <ubizjak at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Last reconfirmed| |2012-03-09 Resolution|FIXED | Ever Confirmed|0 |1 --- Comment #5 from Uros Bizjak <ubizjak at gmail dot com> 2012-03-09 14:55:18 UTC --- However, there is a problem with Pmode != DImode. Consider following test: struct foo { int *f; int i; }; void __attribute__ ((noinline)) bar (struct foo x) { *(x.f) = 1; } This will compile with -mx32 to: bar: movl $1, (%rdi) ret which is wrong. The move is: #(insn:TI 6 3 13 2 (set (mem:SI (reg:SI 5 di [orig:60 x ] [60]) [4 *D.1704_1+0 S4 A32]) # (const_int 1 [0x1])) ptr.c:11 64 {*movsi_internal} # (expr_list:REG_DEAD (reg:SI 5 di [orig:60 x ] [60]) # (nil))) movl $1, (%rdi) # 6 *movsi_internal/2 [length = 6] So we want to output address in SImode, while avoiding addr32 prefixes for LEAs. The patch from H.J. should be applied and LEAs should be fixed.