This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/25227] struct whos size is > 64bit is always on the stack
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2005 18:26:38 -0000
- Subject: [Bug middle-end/25227] struct whos size is > 64bit is always on the stack
- References: <bug-25227-10043@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-12-02 18:26 -------
Confirmed, Even though it is returned on the registers:
(call_insn 13 12 14 (set (parallel:BLK [
(expr_list:REG_DEP_TRUE (reg:DI 0 ax)
(const_int 0 [0x0]))
(expr_list:REG_DEP_TRUE (reg:DI 1 dx)
(const_int 8 [0x8]))
])
(call (mem:QI (symbol_ref:DI ("vfs_read") [flags 0x41] <function_decl
0x2aaaab162e00 vfs_read>) [0 S1 A8])
(const_int 0 [0x0]))) -1 (nil)
(nil)
(expr_list:REG_DEP_TRUE (use (reg:DI 5 di))
(nil)))
we store the struct directly to the stack right after that:
(insn 16 15 17 (set (mem/s/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
(const_int -32 [0xffffffffffffffe0])) [4 S8 A128])
(reg:DI 61)) -1 (nil)
(nil))
(insn 17 16 18 (set (mem/s/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
(const_int -24 [0xffffffffffffffe8])) [4 S8 A64])
(reg:DI 62)) -1 (nil)
(nil))
and then we load it and store it again:
(insn 18 17 19 (set (reg:DI 63)
(mem/s/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
(const_int -32 [0xffffffffffffffe0])) [4 S8 A128])) -1 (nil)
(nil))
(insn 19 18 20 (set (mem/s/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
(const_int -16 [0xfffffffffffffff0])) [4 D.1642+0 S8 A64])
(reg:DI 63)) -1 (nil)
(nil))
(insn 20 19 21 (set (reg:DI 64)
(mem/s/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
(const_int -24 [0xffffffffffffffe8])) [4 S8 A64])) -1 (nil)
(nil))
(insn 21 20 0 (set (mem/s/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
(const_int -8 [0xfffffffffffffff8])) [4 D.1642+8 S8 A64])
(reg:DI 64)) -1 (nil)
(nil))
This is a mess.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC build triplet|x86_64-unknown-linux |
GCC host triplet|x86_64-unknown-linux |
GCC target triplet|x86_64-unknown-linux |
Keywords| |missed-optimization
Last reconfirmed|0000-00-00 00:00:00 |2005-12-02 18:26:38
date| |
Summary|code generation -- |struct whos size is > 64bit
|unnecessary spill of |is always on the stack
|structure onto stack |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25227