Jump to page: 1 2
Thread overview
llvm 3.6 and x86 (32-bit) varargs bad stack adjust
Jul 12, 2015
Dan Olson
Jul 13, 2015
Kai Nacke
Jul 13, 2015
Dan Olson
Jul 13, 2015
Dan Olson
Jul 13, 2015
David Nadlinger
Jul 14, 2015
Dan Olson
Jul 14, 2015
Kai Nacke
Jul 15, 2015
Dan Olson
Jul 15, 2015
Kai Nacke
Jul 14, 2015
David Nadlinger
Jul 15, 2015
Kai Nacke
Jul 16, 2015
Dan Olson
July 12, 2015
I haven't been paying attention, so perhaps this is old news.  D varargs is broken with LDC 0.15.2 and LLVM 3.6 releases.  It looks like an incorrect stack adjust is being added by backend after the function call.  I noticed when I ran unittests and std.outbuffer plus other unittests segv.

I tried LLVM 3.6.0, 3.6.1, and latest version on release_36 branch.  All fail same way.  LLVM 3.5 seems ok.

Is there an Issue on this yet?
--
Dan
July 13, 2015
On Sunday, 12 July 2015 at 07:09:33 UTC, Dan Olson wrote:
> I haven't been paying attention, so perhaps this is old news.  D varargs is broken with LDC 0.15.2 and LLVM 3.6 releases.  It looks like an incorrect stack adjust is being added by backend after the function call.  I noticed when I ran unittests and std.outbuffer plus other unittests segv.
>
> I tried LLVM 3.6.0, 3.6.1, and latest version on release_36 branch.  All fail same way.  LLVM 3.5 seems ok.
>
> Is there an Issue on this yet?
> --
> Dan

Hi Dan!

There is no ldc issue yet. Did you check with LLVM 3.7? If we can produce a LLVM bug report then we could try to set this as a release blocker. Branching for the 3.7 release is tomorrow.

Regards,
Kai
July 13, 2015
https://github.com/ldc-developers/ldc/issues/1000

Do I win something for Issue 1000?
July 13, 2015
"Kai Nacke" <kai@redstar.de> writes:
>
> There is no ldc issue yet. Did you check with LLVM 3.7? If we can produce a LLVM bug report then we could try to set this as a release blocker. Branching for the 3.7 release is tomorrow.

No, I have not tried 3.7 and I won't have time for a couple days.

I don't understand the history of why LDC uses X86_StdCall for Posix. It says in LLVM docs that it is mostly used by Win32.  Perhaps it is not well tested outside Windows.  I don't think this new Issue is a problem on Windows.
July 13, 2015
On Monday, 13 July 2015 at 17:04:55 UTC, Dan Olson wrote:
> I don't understand the history of why LDC uses X86_StdCall for Posix.

The reasons are indeed mainly historic in so far as this is what DMD does, and we want to match DMD's calling convention as closely as possible for naked inline assembly.

 — David
July 14, 2015
Dan Olson <gorox@comcast.net> writes:

> "Kai Nacke" <kai@redstar.de> writes:
>>
>> There is no ldc issue yet. Did you check with LLVM 3.7? If we can produce a LLVM bug report then we could try to set this as a release blocker. Branching for the 3.7 release is tomorrow.
>
> No, I have not tried 3.7 and I won't have time for a couple days.

Same problem with LLVM master 3.7.0svn.

July 14, 2015
On Monday, 13 July 2015 at 04:34:00 UTC, Kai Nacke wrote:
> There is no ldc issue yet. Did you check with LLVM 3.7? If we can produce a LLVM bug report then we could try to set this as a release blocker. Branching for the 3.7 release is tomorrow.

So if this is really an LLVM bug that we cannot work around easily, what is our plan for the next LDC release(s)?

 — David
July 14, 2015
On Monday, 13 July 2015 at 17:04:55 UTC, Dan Olson wrote:
> "Kai Nacke" <kai@redstar.de> writes:
>>
>> There is no ldc issue yet. Did you check with LLVM 3.7? If we can produce a LLVM bug report then we could try to set this as a release blocker. Branching for the 3.7 release is tomorrow.
>
> No, I have not tried 3.7 and I won't have time for a couple days.
>
> I don't understand the history of why LDC uses X86_StdCall for Posix. It says in LLVM docs that it is mostly used by Win32.  Perhaps it is not well tested outside Windows.  I don't think this new Issue is a problem on Windows.

stdcall conventions does not support variadic arguments. Or am I wrong?

Regards,
Kai
July 15, 2015
"Kai Nacke" <kai@redstar.de> writes:

> On Monday, 13 July 2015 at 17:04:55 UTC, Dan Olson wrote:
>> "Kai Nacke" <kai@redstar.de> writes:
>>>
>>> There is no ldc issue yet. Did you check with LLVM 3.7? If we can produce a LLVM bug report then we could try to set this as a release blocker. Branching for the 3.7 release is tomorrow.
>>
>> No, I have not tried 3.7 and I won't have time for a couple days.
>>
>> I don't understand the history of why LDC uses X86_StdCall for Posix. It says in LLVM docs that it is mostly used by Win32. Perhaps it is not well tested outside Windows.  I don't think this new Issue is a problem on Windows.
>
> stdcall conventions does not support variadic arguments. Or am I wrong?
>
> Regards,
> Kai

Yeah, I read that too.  That is why I was curious about the history of using X86_StdCall.  Didn't D-style variadics changed in 0.15.2 from a pointer to varags to a true variadic call.  Could that be related?  I decided to start looks at diffs in LLVM source from 3.5 to 3.6 to see what might have happened there too.  Maybe LDC is just using X86_StdCall in a "non-Std" way.
July 15, 2015
On Wednesday, 15 July 2015 at 06:32:32 UTC, Dan Olson wrote:
> "Kai Nacke" <kai@redstar.de> writes:
>
>> On Monday, 13 July 2015 at 17:04:55 UTC, Dan Olson wrote:
>>> "Kai Nacke" <kai@redstar.de> writes:
>>>>
>>>> There is no ldc issue yet. Did you check with LLVM 3.7? If we can produce a LLVM bug report then we could try to set this as a release blocker. Branching for the 3.7 release is tomorrow.
>>>
>>> No, I have not tried 3.7 and I won't have time for a couple days.
>>>
>>> I don't understand the history of why LDC uses X86_StdCall for Posix. It says in LLVM docs that it is mostly used by Win32. Perhaps it is not well tested outside Windows.  I don't think this new Issue is a problem on Windows.
>>
>> stdcall conventions does not support variadic arguments. Or am I wrong?
>>
>> Regards,
>> Kai
>
> Yeah, I read that too.  That is why I was curious about the history of using X86_StdCall.  Didn't D-style variadics changed in 0.15.2 from a pointer to varags to a true variadic call.  Could that be related?  I decided to start looks at diffs in LLVM source from 3.5 to 3.6 to see what might have happened there too.  Maybe LDC is just using X86_StdCall in a "non-Std" way.

Yes, that is the difference. With 0.15.1 there is no variadic call.
I think we must change calling convention to cdecl for variadic D functions.

Regards,
Kai
« First   ‹ Prev
1 2