Date: Thu, 25 Jul 1996 17:13:15 +0200 (IST) From: Eli Zaretskii To: Laurentiu Badea Cc: djgpp AT delorie DOT com Subject: Re: Argument passing control ( a la Watcom ) In-Reply-To: <31F613B9.2ACB1288@lmn.pub.ro> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 24 Jul 1996, Laurentiu Badea wrote: > In Watcom one has very good control of how function arguments are passed > (for example, I can say first arg in EAX, second in BL and the third on > stack ) How can I do this with djgpp ( or with gcc for that matter ). From the GCC on-line docs: -mregparm=num Control how many registers are used to pass integer arguments. By default, no registers are used to pass arguments, and at most 3 registers can be used. You can control this behavior for a specific function by using the function attribute `regparm'. See "Function Attributes". Warning: if you use this switch, and `num' is nonzero, then you must build all modules with the same value, including any libraries. This includes the system libraries and startup modules. > And another question: gcc crashes when compiling file tif_fax3.c from > the tiff library package (all the other files compile ok). By "crashes" > I mean a SIGSEGV. I tried growing the stack as described in the faq, but > it doesn't work. The FAQ also explains (section 6.4) that there is another possible cause for such crashes, which is due to the specifics of CWSDPMI memory allocation. Do you use CWSDPMI as your DPMI host? If so, please download the latest release 2 of CWSDPMI and see if that helps. Release 2 allows you to enlarge its internal data size by running CWSPARAM program, so if the crashes won't go away with r2, try bumping up the heap size of CWSDPMI. > The file isn't large at all. I can't get it to compile. The size of the file usually isn't an issue here. GCC sometimes allocates preposterous amounts of memory when it tries hard to parse or optimize some seemingly naive source files. If you compile with optimizations, try removing the -On (where n is a number) switch from the compilation command line. If nothing above helps, post the file source.