www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2017/03/12/00:15:50

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20161025;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to;
bh=QbJVomh4blxTfWBR3pRLus46ZuGS95BJqwfv7FEHM98=;
b=Tby176GtpOMRSpORgKr6V1KnCnbMR9cfmuY+PAOl9kq3nhdH/LiLlKwylP9NvM+1ty
aNH81XZUHjQxOcBS0U9cVKd03cDoJuwNAVbRWUY1Oa06ofKtos9Pb/yumHUm7g9v/FXI
Z75CgVCHWaWhZTq+Y2wjTsimGT+MUrBKLGYmO+nu4zumG5TQ57V0EF5LR6hU2Z/XZtOe
kaxwHqyUMMPwRsFR8p04dQorhza/bw2//wVqCOltWRLXL0GAQdm7ZEuzMP6SZhrKXgF1
UWj+Wk/Ha9mLfz/LGuDDwkHQ7SEVNgQwf4UqoMCmscDkf41DREh+VP590no88mmRZ2GD
uIjQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:in-reply-to:references:from:date
:message-id:subject:to;
bh=QbJVomh4blxTfWBR3pRLus46ZuGS95BJqwfv7FEHM98=;
b=GV2fUpfcyNGGn9d6fBMJC0eXmVYb4A2w2tFbucRJCWVGL28U8/RIVrdVZ/KY6PW0XL
wN2GPooJbZJdn58FBMdYiNR3RL2KbsSDZW5Zw0pyrgEZlB/XsvM9elmQYBlnOJVhxdjP
fPvfteGuZUGqEbPXkySpvoc9jovA1TBt9k4XrpDcmSt1y+x110rLDpfkF2yNjNaCiI58
LmihnPPu2xsxiGJvftouS6fYJ79pb5P2XLJBTz3BY+Ju2fsPeFgsInZrQsA8PsVtCwth
Ehnou/CZCFnB/9Y9iOizoSNH+U0fZFiC0WgP+TLQWcLwp7jcDtVPA6DfHKB3JfD2PZAS
apoQ==
X-Gm-Message-State: AFeK/H0wivx+/cBpFClsDniFK9HTSXqe/HvDpDLzfK6cclewaxiSa3ACn1hZqFbivA52SYOfYQ2b+mhJGXa7Nw==
X-Received: by 10.36.91.142 with SMTP id g136mr6009572itb.52.1489295740276;
Sat, 11 Mar 2017 21:15:40 -0800 (PST)
MIME-Version: 1.0
In-Reply-To: <eaa5f75a-3128-4309-8d28-ab3a9ca1566b@googlegroups.com>
References: <a3cedf91-bd02-46a1-9f41-58a9747747b7 AT googlegroups DOT com>
<CAB9Rao8M=6bk+2BJGsCCQVs0q_aUHwf3+6zP+aG+k4oywE3LOQ AT mail DOT gmail DOT com> <eaa5f75a-3128-4309-8d28-ab3a9ca1566b AT googlegroups DOT com>
From: "Louis Santillan (lpsantil AT gmail DOT com) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Date: Sat, 11 Mar 2017 21:15:39 -0800
Message-ID: <CAB9Rao9rmU8wSxVGYEbkWut8qdc_CtvYX620tA1nEWRbpepe9w@mail.gmail.com>
Subject: Re: BUG: djgpp should allow 16-byte alignment
To: "djgpp AT delorie DOT com" <djgpp AT delorie DOT com>
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

--001a11410e909098fb054a81af06
Content-Type: text/plain; charset=UTF-8

Have you tried using `-mstackrealign`?  That might correct the errors you
are seeing.  Without seeing any code, it's hard to say what's going on.
Looking at BZ, I see the code there but no compiler flags.

On Fri, Mar 10, 2017 at 12:08 AM, jwjagersma AT gmail DOT com [via
djgpp AT delorie DOT com] <djgpp AT delorie DOT com> wrote:

> 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] <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.
>
>

--001a11410e909098fb054a81af06
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Have you tried using `<span style=3D"color:rgb(0,0,0);font=
-family:monospace;font-size:medium">-mstackrealign`?=C2=A0 That might corre=
ct the errors you are seeing.=C2=A0 Without seeing any code, it&#39;s hard =
to say what&#39;s going on.=C2=A0 Looking at BZ, I see the code there but n=
o compiler flags.</span></div><div class=3D"gmail_extra"><br><div class=3D"=
gmail_quote">On Fri, Mar 10, 2017 at 12:08 AM, <a href=3D"mailto:jwjagersma=
@gmail.com">jwjagersma AT gmail DOT com</a> [via <a href=3D"mailto:djgpp AT delorie DOT c=
om">djgpp AT delorie DOT com</a>] <span dir=3D"ltr">&lt;<a href=3D"mailto:djgpp AT de=
lorie.com" target=3D"_blank">djgpp AT delorie DOT com</a>&gt;</span> wrote:<br><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
ccc solid;padding-left:1ex"><span class=3D"">On Friday, 10 March 2017 00:13=
:25 UTC+1, Louis Santillan (<a href=3D"mailto:lpsantil AT gmail DOT com">lpsantil@=
gmail.com</a>) [via <a href=3D"mailto:djgpp AT delorie DOT com">djgpp AT delorie DOT com<=
/a>]=C2=A0 wrote:<br>
&gt; Are you unable to use `--mstackrealign`, `-mpreferred-stack-boundary=
=3D<wbr>num`, `-mincoming-stack-boundary=3D<wbr>num` [0]?=C2=A0 Looks like =
you&#39;ll also need to force those options if you compile with `-Os` as we=
ll.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; [0] <a href=3D"https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/i386-and-x=
86-64-Options.html#i386-and-x86-64-Options" rel=3D"noreferrer" target=3D"_b=
lank">https://gcc.gnu.org/<wbr>onlinedocs/gcc-4.8.5/gcc/i386-<wbr>and-x86-6=
4-Options.html#i386-<wbr>and-x86-64-Options</a>=C2=A0=C2=A0<br>
&gt;<br>
&gt;<br>
</span><span class=3D"">&gt; On Thu, Mar 9, 2017 at 8:14 AM, <a href=3D"mai=
lto:jwjag DOT  DOT  DOT  AT gmail DOT com">jwjag DOT  DOT  DOT  AT gmail DOT com</a> [via <a href=3D"mailto:dj...=
@delorie.com">dj DOT  DOT  DOT  AT delorie DOT com</a>] &lt;<a href=3D"mailto:dj DOT  DOT  DOT  AT delorie DOT co=
m">dj DOT  DOT  DOT  AT delorie DOT com</a>&gt; wrote:<br>
&gt; Currently it seems that djgpp does not support 16-byte alignment. Sinc=
e djgpp-compiled programs can potentially use SSE instructions (either expl=
icitly or implicitly, when compiled with -march=3Dpentium3), I do think thi=
s should be supported.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; previous discussion:<br>
&gt;<br>
&gt; &gt; <a href=3D"https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D79935" =
rel=3D"noreferrer" target=3D"_blank">https://gcc.gnu.org/bugzilla/<wbr>show=
_bug.cgi?id=3D79935</a><br>
<br>
</span>I was already using -mpreferred-stack-boundary=3D4 (which implies -m=
incoming-stack-boundary=3D4) but that didn&#39;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.<br>
<br>
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 =3D=
=3D 0x0c). That doesn&#39;t make any sense at all! It&#39;s guaranteed to c=
ause a GP fault and gcc should know this.<br>
<br>
</blockquote></div><br></div>

--001a11410e909098fb054a81af06--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019