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

            Bug ID: 57845
           Summary: ICE with -freg-struct-return on Sparc target
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: adam at os dot inf.tu-dresden.de
              Host: x86_64
            Target: sparc

The following code produces an ICE for a Sparc target, with 4.9.0. Also tested
4.7.4 and 4.8.2 with same result. No ICE for target x86 for any version tested.
No ICE with-freg-struct-return removed.

class foo
{
public:
  struct r { };
};

class c
{ 
  foo::r func(foo::r);
};

foo::r c::func(foo::r x)
{
  return x;
}

$ sparc-linux-g++ -m32 -c  -freg-struct-return  x.i
x.i: In member function ‘foo::r c::func(foo::r)’:
x.i:15:10: internal compiler error: in emit_move_insn, at expr.c:3486
   return x;
          ^
0x85ba84 emit_move_insn(rtx_def*, rtx_def*)
        /tmp/gcc/head/gcc/gcc/expr.c:3485
0xa80620 expand_value_return
        /tmp/gcc/head/gcc/gcc/stmt.c:1460
0x78f5f1 expand_gimple_stmt_1
        /tmp/gcc/head/gcc/gcc/cfgexpand.c:2248
0x78f5f1 expand_gimple_stmt
        /tmp/gcc/head/gcc/gcc/cfgexpand.c:2370
0x7910a7 expand_gimple_basic_block
        /tmp/gcc/head/gcc/gcc/cfgexpand.c:4204
0x793806 gimple_expand_cfg
        /tmp/gcc/head/gcc/gcc/cfgexpand.c:4723
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.


Adam

Reply via email to