Date: Mon, 24 Apr 1995 10:43:54 +1100 From: Bill Currie Subject: Re: More optimization woes... To: Bill Davidson Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Organization: Tait Electronics Ltd. > Hi all: > This may not be a djgpp problem (if not, tell me so and where to gripe) > but here it is: > I have a program that uses inline (eg _farptr) functions, so I want to > compile with optimization (-O or -O2). However, I am getting some weird > code generation, viz: > > int ListProc (WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2) { > [snip] > switch (msg) { > case CREATE_WINDOW: > wnd->ct = DFmalloc(sizeof(CTLWINDOW)); > wnd->ct->setting = OFF; // line 53 > [snip] > > Under edebug32, it seems that line 53 is the first line that is executed; > the DFmalloc() line is not executed, and so wnd->ct is NULL and so > dereferencing it produces an exception. I don't know wether your using C or C++ (or the version) but the 2.5.7 version of gnu c++ seems to trash the line number debuggin information.