egcs crashes when working with -O0 ?

Jeffrey A Law law@cygnus.com
Tue Jun 30 23:56:00 GMT 1998


  In message <41256633.004AE98F.00@elsa.de>you write:
  > Now, to my problem:  I experienced random crashes of the compiler
  > pass (cc1) when compiling without any optimization (i.e. '-O0'), especially
  > when the option '-fomit-frame-pointer' was also present.
Note that -fomit-frame-pointer is really meant to be used with optimization
enabled.  -fomit-frame-pointer is never tested without optimization.

  > The module 'jump.c' works with a table called 'jump_chain'. Space for
  > this table is allocated in function 'jump_optimize()' with alloca(), so the
  > memory is released automatically at function end.
Right.


  > jump_optimize() explicitly sets the pointer to 0 at function exit
  > probably to inform other functions that the array is not usable
  > any more (I never would claim that I actually understand
  > what is going on in this module!).
Right.  Several of the functions in jump.c are used by other parts
of the compiler.  For example "redirect_jump".  Thus we need to know
when the jump chain is valid and when it is invalid.


  > However, there is a branch taken inside jump_optimize() in the
  > case of no optimization that ends with a return statement,
  > and the pointer isn't reset to 0 prior to the return.  After
  > inserting a
  >  
  > jump_chain = 0;
  > 
  > prior to line 303 in jump.c, the crashes vanished :-)
Thanks.  It's usually best to use diff -c oldfile newfile for this
kind of stuff so that we can see the context around the change you
want to make.  Rarely do line numbers match up.


  > firmware...I however hope that I still gave enough information to
  > understand where I see the problem.
You have.  I've just fixed this problem.

Thanks,
jeff



More information about the Gcc-bugs mailing list