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]

egcs crashes when working with -O0 ?


Dear egcs developers,

first, I must thank you for egcs!  My company just has begun to use
egcs for a Hitachi SH3-based project since it immediately cured
some coding bugs present in gcc 2.8.1.

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.  After a bit of
searching in the egcs sources, I think I found what the problem is (at
least
the crashes I saw did not occur again..):

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.  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!).  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 :-)

I was working with egcs on a Pentium-200 machine running Windows NT 4.0
and the CygWin32 B19 environment.  The egcs version was the developer
snapshot from June 8th, 1998.  The problem however still seems to be
present
in the most recent snapshot from June 28th, 1998.  I'm sorry I cannot show
some
actual code that triggered the problem, since my company lives of selling
the
firmware...I however hope that I still gave enough information to
understand where
I see the problem.

Yours

Alfred Arnold

____________________________________________________________

 Alfred Arnold      Software developer
 ELSA AG
 Sonnenweg 11       Phone:    +49-(0)241-606-2087
 52070 Aachen       Fax: +49-(0)241-606-2099
 Germany       EMail:    aarnold@elsa.de
____________________________________________________________





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