https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57845

Sergey Organov <sorganov at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sorganov at gmail dot com

--- Comment #2 from Sergey Organov <sorganov at gmail dot com> ---
Just ran into this ICE with gcc 5.2.0 sparc-elf target. How comes ICE gets
"WONT FIX" "resolution"??? 

BTW, gcc 3.4.4 did support -freg-struct-return on sparc-elf. Here is simple
code on which gcc 5.2.0 ICEs, along with asm output from gcc 3.4.4:

$ cat struct.c
typedef struct { short int i; } T;

T f(short int i)
{
  T r;
  r.i = i;
  return r;
}
$ ~/try/sparc-elf-5.2.0/bin/sparc-elf-gcc -O0 -v -freg-struct-return -c
struct.c
Using built-in specs.
COLLECT_GCC=/home/osv/try/sparc-elf-5.2.0/bin/sparc-elf-gcc
Target: sparc-elf
Configured with: ../../gcc/configure --prefix=/home/osv/try/sparc-elf-5.2.0
--target=sparc-elf --enable-languages=c,c++ --disable-shared --disable-lto
--disable-nls --disable-libstdcxx --disable-libssp --disable-__cxa_atexit
--disable-newlib-hw-fp --with-gnu-as --with-gnu-ld -with-newlib --with-cpu=v8
Thread model: single
gcc version 5.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-O0' '-v' '-freg-struct-return' '-c' '-mcpu=v8'
 /home/osv/try/sparc-elf-5.2.0/libexec/gcc/sparc-elf/5.2.0/cc1 -quiet -v
-imultilib v8 -D__sparc_v8__ struct.c -quiet -dumpbase struct.c -mcpu=v8
-auxbase struct -O0 -version -freg-struct-return -o /tmp/cc8Q7Kz8.s
GNU C11 (GCC) version 5.2.0 (sparc-elf)
        compiled by GNU C version 4.4.5 20101112 (Red Hat 4.4.5-2), GMP version
5.0.1, MPFR version 3.0.0, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/home/osv/try/sparc-elf-5.2.0/lib/gcc/sparc-elf/5.2.0/../../../../sparc-elf/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /home/osv/try/sparc-elf-5.2.0/lib/gcc/sparc-elf/5.2.0/include
 /home/osv/try/sparc-elf-5.2.0/lib/gcc/sparc-elf/5.2.0/include-fixed

/home/osv/try/sparc-elf-5.2.0/lib/gcc/sparc-elf/5.2.0/../../../../sparc-elf/include
End of search list.
GNU C11 (GCC) version 5.2.0 (sparc-elf)
        compiled by GNU C version 4.4.5 20101112 (Red Hat 4.4.5-2), GMP version
5.0.1, MPFR version 3.0.0, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 88c66c4c8e0ff180c6a3d3a418365f25
struct.c: In function 'f':
struct.c:7:10: internal compiler error: in emit_move_insn, at expr.c:3601
   return r;
          ^
0x66a1bc emit_move_insn(rtx_def*, rtx_def*)
        ../../../gcc/gcc/expr.c:3601
0x59ba27 expand_value_return
        ../../../gcc/gcc/cfgexpand.c:3177
0x59f30c expand_return
        ../../../gcc/gcc/cfgexpand.c:3300
0x59f30c expand_gimple_stmt_1
        ../../../gcc/gcc/cfgexpand.c:3373
0x59f30c expand_gimple_stmt
        ../../../gcc/gcc/cfgexpand.c:3497
0x5a18ea expand_gimple_basic_block
        ../../../gcc/gcc/cfgexpand.c:5509
0x5a66a7 execute
        ../../../gcc/gcc/cfgexpand.c:6127
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ /opt/sparc-elf-3.4.4/bin/sparc-elf-gcc -O0 -v -freg-struct-return -save-temps
-c struct.c
Reading specs from /opt/sparc-elf-3.4.4/lib/gcc/sparc-elf/3.4.4/specs
Configured with: ../gcc-3.4.4/configure --target=sparc-elf
--prefix=/opt/sparc-elf-3.4.4 --with-gnu-as --with-gnu-ld --verbose
--enable-languages=c,c++ --disable-shared --disable-nls --with-newlib
--with-cpu=leon
Thread model: single
gcc version 3.4.4
 /opt/sparc-elf-3.4.4/libexec/gcc/sparc-elf/3.4.4/cc1 -E -quiet -v
-D__leonbare__ struct.c -freg-struct-return -O0 -o struct.i
ignoring nonexistent directory
"/opt/sparc-elf-3.4.4/lib/gcc/sparc-elf/3.4.4/../../../../sparc-elf/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/sparc-elf-3.4.4/lib/gcc/sparc-elf/3.4.4/include
 /opt/sparc-elf-3.4.4/lib/gcc/sparc-elf/3.4.4/../../../../sparc-elf/include
End of search list.
 /opt/sparc-elf-3.4.4/libexec/gcc/sparc-elf/3.4.4/cc1 -fpreprocessed struct.i
-quiet -dumpbase struct.c -auxbase struct -O0 -version -freg-struct-return -o
struct.s
GNU C version 3.4.4 (sparc-elf)
        compiled by GNU C version 3.4.6.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 /opt/sparc-elf-3.4.4/lib/gcc/sparc-elf/3.4.4/../../../../sparc-elf/bin/as -V
-Qy -s -o struct.o struct.s
GNU assembler version 2.16.1 (sparc-elf) using BFD version 2.16.1
$ cat struct.s
        .file   "struct.c"
        .section        ".text"
        .align 4
        .global f
        .type   f, #function
        .proc   010
f:
        !#PROLOGUE# 0
        save    %sp, -112, %sp
        !#PROLOGUE# 1
        mov     %i0, %g1
        sth     %g1, [%fp+68]
        lduh    [%fp+68], %g1
        sth     %g1, [%fp-10]
        lduh    [%fp-10], %g1
        mov     %g1, %i0
        ret
        restore
        .size   f, .-f
        .ident  "GCC: (GNU) 3.4.4"
$

Reply via email to