testsuite: optimization dependent test

Iain Buclaw ibuclaw at ubuntu.com
Mon Mar 25 12:26:10 PDT 2013


On 25 March 2013 18:36, Johannes Pfau <nospam at example.com> wrote:

> In runnable/test42.d test7290 checks if a scope delegate is really
> allocated on the stack. To verify this it obtains the EBP pointer and
> compares that to the delegates .ptr.
>
> The problem is that as soon as we enable optimization gcc no
> longer adjusts the EBP pointer when calling the helper functions and
> the test fails...
>
> This test seems to be very fragile in general so what should we do
> about this?
>
>
> BTW: I introduced a small typo in test7290 when porting to GCC asm:
> The test in the main test7290 function should check "assert(dg.ptr <=
> p);", not "assert(p < dg.ptr);"
>


1.  Revert your typo.

2. Raise with a thread in dmd-internals about it. -O2 in GDC triggers
-fomit-frame-pointer.  I'm 90% certain that Walter will say that any
function with assembly inside requires that a frame pointer must always be
present (except in naked function), but that is absolute rubbish.  For
x86_64 (at least), the ABI encourages the absence of a frame pointer.


Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20130325/15da324e/attachment.html>


More information about the D.gnu mailing list