|
From: Danny S. <dan...@cl...> - 2003-10-08 07:30:54
|
----- Original Message ----- From: "Ranjit Mathew" > >> Is there a particular reason to remove it > >> though, apart from when statically linking > >> GCC-compiled objects with MSVC programs > >> or vice versa? > > > > Yes, it plays up with optimisation using > > -funit-at-a-time in CVS gcc, > > More specifically, -funit-at-a-time (which is > now enabled by -O2) changes the calling > conventions of local functions (functions that > are defined, accessible and used within a single > compilation unit) to use as many (max. three?) > registers for passing parameters as possible. > > MinGW/Cygwin's current implementation of > __chkstk/_alloca clobbers EAX, resulting in > a parameter to local functions getting > converted to garbage. > > This specifically causes a crash in > the GCJ parser on MinGW. > > So either __chkstk/_alloca has to be done > away with or modified to not clobber EAX (and > use something else to get the stack size value). > BTW, this is not a new bug it has been around since 2.95 days. Here is a testcase that shows the behaviour: http://www.cygwin.com/ml/cygwin/2002-06/msg00122.html If change regparm(3) to fastcall, the above testcase succeeds. Hmm, maybe that's why MS designed fastcall to use ECX, not EAX as the first allocated register. Danny > Otherwise, 3.4 will be grief incarnate for > MinGW/Cygwin. > > Ranjit. > > -- > Ranjit Mathew Email: rmathew AT hotmail DOT com > > Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/ > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > MinGW-dvlpr mailing list > Min...@li... > https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr |