X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Received: by 10.129.172.6 with SMTP id k6mr7546479ywh.52.1489133293644; Fri, 10 Mar 2017 00:08:13 -0800 (PST) X-Received: by 10.157.82.72 with SMTP id q8mr1997284otg.4.1489133293601; Fri, 10 Mar 2017 00:08:13 -0800 (PST) Newsgroups: comp.os.msdos.djgpp Date: Fri, 10 Mar 2017 00:08:13 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse AT google DOT com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=84.82.215.132; posting-account=JWQfLgoAAAC8QKtkzNbcIxeduALJ3mlU NNTP-Posting-Host: 84.82.215.132 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: BUG: djgpp should allow 16-byte alignment From: "jwjagersma AT gmail DOT com [via djgpp AT delorie DOT com]" Injection-Date: Fri, 10 Mar 2017 08:08:13 +0000 Content-Type: text/plain; charset=UTF-8 Bytes: 2865 Lines: 35 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v2A8F2Ch002786 Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Friday, 10 March 2017 00:13:25 UTC+1, Louis Santillan (lpsantil AT gmail DOT com) [via djgpp AT delorie DOT com] wrote: > Are you unable to use `--mstackrealign`, `-mpreferred-stack-boundary=num`, `-mincoming-stack-boundary=num` [0]?  Looks like you'll also need to force those options if you compile with `-Os` as well. > > > > > [0] https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/i386-and-x86-64-Options.html#i386-and-x86-64-Options   > > > On Thu, Mar 9, 2017 at 8:14 AM, jwjag DOT DOT DOT AT gmail DOT com [via dj DOT DOT DOT AT delorie DOT com] wrote: > Currently it seems that djgpp does not support 16-byte alignment. Since djgpp-compiled programs can potentially use SSE instructions (either explicitly or implicitly, when compiled with -march=pentium3), I do think this should be supported. > > > > previous discussion: > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79935 I was already using -mpreferred-stack-boundary=4 (which implies -mincoming-stack-boundary=4) but that didn't seem to have the intended effect. Most notably in static constructors, the stack alignment is always 8 bytes off. From the disassembly I can tell gcc does its best to keep the stack aligned, so that part works correctly, at least. Now yesterday I had a problem in a non-static function, where gcc inserted an SSE instruction with a memory operand [ebp-0x58], with (ebp % 0x10 == 0x0c). That doesn't make any sense at all! It's guaranteed to cause a GP fault and gcc should know this.