Bug 1042 – internal compiler error: in output_pic_addr_const, at config/i386/i386.c:7023

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2007-03-08T10:33:00Z
Last change time
2015-06-09T01:31:17Z
Assigned to
dvdfrdmn
Creator
thomas-dloop

Comments

Comment #0 by thomas-dloop — 2007-03-08T10:33:57Z
# byte b; # # void main(){ # asm{ # mov EAX, offsetof b; # } # } gdmd-4.0 -arch i386 -O -c nocompile/a/asm_offset_01_B.d nocompile/a/asm_offset_01_B.d: In function 'main': nocompile/a/asm_offset_01_B.d:30: internal compiler error: in output_pic_addr_const, at config/i386/i386.c:7023 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. test case: http://dstress.kuehne.cn/nocompile/a/asm_offset_01_B.d
Comment #1 by dvdfrdmn — 2007-03-10T16:16:17Z
This is a side-effect of MacOS X generating PIC code by default. 'offset b' is not valid for PIC code. The solution is to compile with the -mdynamic-no-pic option.
Comment #2 by thomas-dloop — 2007-03-12T00:29:40Z
(In reply to comment #1) > This is a side-effect of MacOS X generating PIC code by default. Are there any reliable means to detect at compile time if PIC code is generated?
Comment #3 by dvdfrdmn — 2007-03-13T17:02:20Z
> Are there any reliable means to detect at compile time if PIC code is > generated? Not yet. I can add something like version(PIC).
Comment #4 by thomas-dloop — 2007-04-05T03:29:17Z
(In reply to comment #3) > > Are there any reliable means to detect at compile time if PIC code is > > generated? > > Not yet. I can add something like version(PIC). That would be very usefull for me.