D.gnu - testsuite: optimization dependent test
- Johannes Pfau (11/11) Mar 25 2013 In runnable/test42.d test7290 checks if a scope delegate is really
- Iain Buclaw (11/22) Mar 25 2013 1. Revert your typo.
- Johannes Pfau (8/39) Mar 26 2013 2 doesn't sound very promising though. We could just move that test to
- Iain Buclaw (5/44) Mar 26 2013 Have no objections. Have done that for __vector's before ahead of relea...
- Kagamin (10/10) Mar 27 2013 Are you trying to get stack top?
- Kagamin (1/1) Mar 27 2013 core.memory.GC.addrOf(dg.ptr);
- Iain Buclaw (7/8) Mar 29 2013 Done and already merged in.
- Kagamin (2/3) Apr 01 2013 lol, put imports after test3.
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);"
Mar 25 2013
On 25 March 2013 18:36, Johannes Pfau <nospam 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';
Mar 25 2013
Am Mon, 25 Mar 2013 19:26:10 +0000 schrieb Iain Buclaw <ibuclaw ubuntu.com>:On 25 March 2013 18:36, Johannes Pfau <nospam example.com> wrote:2 doesn't sound very promising though. We could just move that test to another file and make sure it's compiled with -fno-inline and fno-omit-frame-pointer. Even if dmd asm may require the frame pointer that needn't be true for gcc asm. BTW: Do we allow backports of specific frontend fixes into gdc? I'd like to merge the fix for the final methods in interfaces problem.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
Mar 26 2013
On 26 March 2013 18:30, Johannes Pfau <nospam example.com> wrote:Am Mon, 25 Mar 2013 19:26:10 +0000 schrieb Iain Buclaw <ibuclaw ubuntu.com>:Have no objections. Have done that for __vector's before ahead of release. -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';On 25 March 2013 18:36, Johannes Pfau <nospam example.com> wrote:2 doesn't sound very promising though. We could just move that test to another file and make sure it's compiled with -fno-inline and fno-omit-frame-pointer. Even if dmd asm may require the frame pointer that needn't be true for gcc asm. BTW: Do we allow backports of specific frontend fixes into gdc? I'd like to merge the fix for the final methods in interfaces problem.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
Mar 26 2013
Are you trying to get stack top? void test(scope void delegate() dg) { int[2] top; void* p=top.ptr; assert(p < dg.ptr); assert(dg.ptr !is null); //also check that ptr is not in heap assert(gc_addrOf(dg.ptr) is null); }
Mar 27 2013
On 28 March 2013 04:47, Kagamin <spam here.lot> wrote:core.memory.GC.addrOf(dg.ptr);Done and already merged in. https://github.com/D-Programming-Language/dmd/pull/1809 Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
Mar 29 2013
On Friday, 29 March 2013 at 13:24:42 UTC, Iain Buclaw wrote:https://github.com/D-Programming-Language/dmd/pull/1809lol, put imports after test3.
Apr 01 2013