gcc code may user more of the stack than whatever code that msvc produces, thus dipping into the red zone more often. So far, I don't see how the 64k limit of the stack on the main thread can be avoided at all..
On Mon, Jun 8, 2009 at 5:33 PM, Johnny Willemsen <jwillem...@remedy.nl> wrote: > > Hi, > > I have compiled the test program also with msvc for the ebox4300 device. It > seems msvc has the same behavior, the stack66000 fails. > > It is strange why some of our tests do fail with gcc and not with msvc due to > the stack issue. Seems we can't resolve this with cegcc, it is something in > windows ce > > Johnny > > > I've been poking in the stack limit problem that Johnny reported. > > > > Test program attached, it can be used with e.g. > > i386-mingw32ce-gcc -DSTACK_SIZE=6000 -o stack6000.exe stack.c > > i386-mingw32ce-gcc -DSTACK_SIZE=66000 -o stack66000.exe stack.c > > > > The stack6000 execution succeeds and leaves the expected contents in > > out.txt : > > In main > > Size : 6000 > > After memset > > The stack66000 execution creates a dialog on the screen saying > > Application Error > > Application stack66000.EXE encountered a serious error and must > > shut > > down > > It also adds one line to out.txt : > > In main > > > > I've built a linux gcc 4.4.0, as expected the same application has no > > problems on linux. > > > > A difference between the assembly code generated for the two platforms > > (see attached source files) is that the CE version calls a function > > __chkstk to probe the stack (see gcc/config/i386/cygwin.asm), the linux > > version does not. > > > > large: (Linux) > > pushl %ebp > > movl %esp, %ebp > > subl $66024, %esp > > movl $.LC0, %eax > > movl $66000, 8(%esp) > > movl %eax, 4(%esp) > > movl $outbuf, (%esp) > > call sprintf > > movl $outbuf, (%esp) > > call Print > > > > > > _large: (CE) > > pushl %ebp > > movl %esp, %ebp > > movl $66024, %eax > > call ___chkstk > > movl $66000, 8(%esp) > > movl $LC0, 4(%esp) > > movl $_outbuf, (%esp) > > call _sprintf > > movl $_outbuf, (%esp) > > call _Print > > > > I've tried porting the piece of Linux assembler in the CE code. This > > requires adding an underscore at some lines, removing dots at others. > > The end result is the same though : crash. > > > > Help ! :-( > > > > Danny > > -- > > Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info > > > ------------------------------------------------------------------------------ > OpenSolaris 2009.06 is a cutting edge operating system for enterprises > looking to deploy the next generation of Solaris that includes the latest > innovations from Sun and the OpenSource community. Download a copy and > enjoy capabilities such as Networking, Storage and Virtualization. > Go to: http://p.sf.net/sfu/opensolaris-get > _______________________________________________ > Cegcc-devel mailing list > Cegcc-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/cegcc-devel -- With best of best regards Pawel S. Veselov ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ Cegcc-devel mailing list Cegcc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cegcc-devel