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

--- Comment #7 from Stanislav Šimek <stanislav.simek at siemens dot com> ---
(In reply to Richard Biener from comment #3)
> It sounds like this should be a bug for gdb.


Hi all,
I would like to add more information for this topic:

This error occurs in case that your function, call the function that has more
than 8 params.

Eq.
int sum(int x1,int x2 int x3,int x4,int x5,int x6,int x7,int x8,int x9 ); 

int test(int input1 ) 
{
  int c = 0;

  if(input1 == 2) // <- If you have breakpoint here, callstack is corrupted
  {
    c +=input1;
  }

  c =sum(1,2,3,4,5,6,7,c,input1);
  return c;
}


If you remove the call of sum function, then everything works.
If you optimize function " int test(int) " with O0,O1 and O3, it works
Only for O2 this problem occurs.

So isn't it gcc problem?

Reply via email to