This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/57845] ICE with -freg-struct-return on SPARC
- From: "sorganov at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Nov 2015 20:46:38 +0000
- Subject: [Bug target/57845] ICE with -freg-struct-return on SPARC
- Auto-submitted: auto-generated
- References: <bug-57845-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57845
--- Comment #6 from Sergey Organov <sorganov at gmail dot com> ---
Contrary to the rationale for closing this bug, the option -freg-struct-return
seems to be supported and does work fine in some cases, see below. What do I
miss?
$ cat struct.c
typedef struct { int i; } T;
T f(int i)
{
T r;
r.i = i;
return r;
}
$ ~/try/sparc-elf-5.2.0/bin/sparc-elf-gcc -O2 -freg-struct-return -save-temps
-c struct.c
$ cat struct.s
.file "struct.c"
.section ".text"
.align 4
.global f
.type f, #function
.proc 010
f:
jmp %o7+8
nop
.size f, .-f
.ident "GCC: (GNU) 5.2.0"
$ ~/try/sparc-elf-5.2.0/bin/sparc-elf-gcc -O2 -save-temps -c struct.c
$ cat struct.s
.file "struct.c"
.section ".text"
.align 4
.global f
.type f, #function
.proc 010
f:
ld [%sp+64], %g1
st %o0, [%g1]
jmp %o7+12
mov %g1, %o0
.size f, .-f
.ident "GCC: (GNU) 5.2.0"
$