← Back to index
|
Original Bugzilla link
Bug 15736 – clang vs gcc-42 on osx 10.11 (el capitan)
Status
RESOLVED
Resolution
MOVED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2016-03-01T07:12:18Z
Last change time
2022-11-03T10:13:54Z
Assigned to
No Owner
Creator
Brad Roberts
Comments
Comment #0
by braddr — 2016-03-01T07:12:18Z
The dmd unittest cppa.d fails on darwin_64_32 with the default installed compiler (clang 7.0.2). Reverting to the same compiler the other auto-testers are using, gcc 4.2 works. The problem reduces to: --- cppb.cpp --- #include <stdio.h> #include <assert.h> #include <exception> struct S13956 { }; void check13956(S13956 arg0, int arg1); void func13956(S13956 arg0, int arg1) { check13956(arg0, arg1); } --- --- foo.d --- import core.stdc.stdio; import core.stdc.stdarg; import core.stdc.config; struct S13956 { } extern(C++) void func13956(S13956 arg0, int arg1); extern(C++) void check13956(S13956 arg0, int arg1) { printf("1:\n"); assert(arg0 == S13956()); printf("2: %d\n", arg1); assert(arg1 == 1); printf("3:\n"); } void test13956() { func13956(S13956(), 1); } void main() { test13956(); printf("Success\n"); } --- The asm code for the two cpp functions: --- cppb-gcc-42.o --- Disassembly of section __TEXT,__text: __Z9func139566S13956i: 0: 55 pushl %ebp 1: 89 e5 movl %esp, %ebp 3: 83 ec 28 subl $40, %esp 6: 8b 45 0c movl 12(%ebp), %eax 9: 89 44 24 04 movl %eax, 4(%esp) d: 0f b6 45 f7 movzbl -9(%ebp), %eax 11: 88 04 24 movb %al, (%esp) 14: e8 e7 ff ff ff calll -25 <__Z9func139566S13956i> 19: c9 leave 1a: c3 retl --- --- cppb-clang.o --- Disassembly of section __TEXT,__text: __Z9func139566S13956i: 0: 55 pushl %ebp 1: 89 e5 movl %esp, %ebp 3: 83 ec 18 subl $24, %esp 6: 8b 45 08 movl 8(%ebp), %eax 9: 89 45 f4 movl %eax, -12(%ebp) c: 8b 45 f4 movl -12(%ebp), %eax f: 89 04 24 movl %eax, (%esp) 12: e8 e9 ff ff ff calll -23 <__Z9func139566S13956i> 17: 83 c4 18 addl $24, %esp 1a: 5d popl %ebp 1b: c3 retl ---
Comment #1
by braddr — 2016-03-01T08:01:34Z
For the time being, reverted the macair 10.11 auto-tester to gcc 4.2 (for both 32 and 64 builds) until this is fixed.
Comment #2
by braddr — 2016-03-01T08:52:39Z
see also:
https://github.com/ldc-developers/ldc/commit/6f83cb2905e2cbf6b7822bc714ae1cd4481e3193
Comment #3
by razvan.nitu1305 — 2022-11-03T10:13:54Z
This doesn't seem to be a compiler related issue.