This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/61090] New: [4.10 Regression] ICE in build_ref_for_offset


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

            Bug ID: 61090
           Summary: [4.10 Regression] ICE in build_ref_for_offset
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com

gcc 4.10.0-alpha20140504 fails when compiling the following code w/ -O1:

struct i {
   int c;
};

static int
p(struct i a)
{
  return 0;
}

void
h(void)
{
  struct i z[] = {{ 0 }};
  int e[] = {};
  int x;
  e[0] = p(z[x]) + z[x].c;
}

However, 4.10.0-alpha20140411 compiles it just fine.

It seems there's a stack corruption as gdb backtrace shows the following:

----8<----
   0x00000000009036be <+430>:    mov    %rcx,0x8(%rsp)
   0x00000000009036c3 <+435>:    mov    $0x1,%edx
   0x00000000009036c8 <+440>:    mov    %rax,%rsi
   0x00000000009036cb <+443>:    mov    (%rsp),%rdi
   0x00000000009036cf <+447>:    callq  0x7166c8
<_Z17gsi_insert_beforeP20gimple_stmt_iteratorP21gimple_statement_base19gsi_iterator_update>
=> 0x00000000009036d4 <+452>:    mov    0x8(%rsp),%rcx
   0x00000000009036d9 <+457>:    mov    %rcx,(%rsp)
   0x00000000009036dd <+461>:    mov    %rbp,%rdi
   0x00000000009036e0 <+464>:    callq  0x5e905e
<_Z24reference_alias_ptr_typeP9tree_node>
---->8----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]