www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Merge of 2.065.0

reply "Kai Nacke" <kai redstar.de> writes:
Hi all!

Again some news from the bleeding edge: Now the branch 
merge-2.065 contains my
merge of latest dmd release 2.065.0.

Regards,
Kai
Mar 14 2014
next sibling parent reply "Temtaime" <temtaime gmail.com> writes:
Hi Kai !
Now i can build ldc and almost all druntime and phobos.

Only the problem is code.sys.windows.stacktrace in druntime.

LDC shows following error:

Both operands to ICmp instruction are not of the same type!
   %tmp50 = icmp ne [1 x i8] %tmp49, i0 0
Jun 14 2014
parent reply "Temtaime" <temtaime gmail.com> writes:
OK just commented out import of stacktrace and removed stacktrace 
fron my druntime-ldc project.
Now it OK and i can build hello world.
Exceptions are fine.
Jun 14 2014
parent reply "Temtaime" <temtaime gmail.com> writes:
I have big project in D about 14k lines.
Compiling with ldc now ldc crashes at toir.c:1982

Logger::print("EqualExp::toElem: %s   %s\n", toChars(), 
type->toChars());

Debugger says that variable type is null.

If i comment that log message out it gives strange error without 
file and line

Error: Exp type Expression not implemented: p
Jun 14 2014
parent reply "Temtaime" <temtaime gmail.com> writes:
OK reduced test case:

FILE A.d
import B;

FILE B.d
import C;
import D;

import std.range;

class Font {
public:
	mixin RCounted;

	auto makeTextData(string s) {
		// split text by spaces
		auto arr = s.splitter.array;
	}

}

class Engine {
	RC!Font font;
}

FILE C.d
import A;

FILE D.d
template RCounted() {
		void release() { this.destroy; }
}

struct RC(T) {
	~this() {  _rc_ptr.release; }
	T _rc_ptr;
}


I don't know why that errors occurs really.
Any ideas ?

Want to get LDC compile it.
Jun 14 2014
next sibling parent "Temtaime" <temtaime gmail.com> writes:
http://a-rei.ru/YVHr
Callstack here if it'll help
Jun 14 2014
prev sibling parent reply Christian Kamm <kamm incasoftware.de> writes:
On 14.06.2014 17:07, Temtaime wrote:
 OK reduced test case:
Thanks for the awesome bug report! Unfortunately I can't reproduce it with ldc2 -c A.d B.d C.d D.d Is there anything else I need to know?
Jun 14 2014
parent reply "Temtaime" <temtaime gmail.com> writes:
Try to specify only A.d


ldc -c A.d B.d C.d D.d
*compiles OK*
ldc -c A.d
Error: Exp type Expression not implemented: p
Jun 14 2014
next sibling parent Christian Kamm <kamm incasoftware.de> writes:
On 14.06.2014 18:08, Temtaime wrote:
 ldc -c A.d B.d C.d D.d
*compiles OK*
 ldc -c A.d
Error: Exp type Expression not implemented: p
That does it, thanks! -vv output: * TemplateInstance::codegen: 'std.array.Appender!(string[])' * * StructDeclaration::codegen: 'std.array.Appender!(string[]).Appender' * * * Resolving struct type: Appender (/home/kamm/eigenes/projekte/ldc/ldc/runtime/phobos/std/array.d(2152)) * * * StructDeclaration::codegen: 'std.array.Appender!(string[]).Appender.Data' ... * * * * DtoDefineFunction(std.array.Appender!(string[]).Appender.Data.__xopEquals): * * * * * Doing function body for: __xopEquals * * * * * Function available externally: __xopEquals * * * * * DtoCreateNestedContext for __xopEquals * * * * * * DtoCreateNestedContextType for __xopEquals * * * * * ReturnStatement::toIR(): * * * * * * Expression::toElemDtor(): p == q and then your stack trace.
Jun 14 2014
prev sibling parent reply Dan Olson <zans.is.for.cans yahoo.com> writes:
"Temtaime" <temtaime gmail.com> writes:

 Try to specify only A.d


ldc -c A.d B.d C.d D.d
*compiles OK*
ldc -c A.d
Error: Exp type Expression not implemented: p
It dumps stack on 2.064 too. I noticed that "ldc -O2 -c A.d" and higher optimization levels work though.
Jun 17 2014
parent reply "Kai Nacke" <kai redstar.de> writes:
On Wednesday, 18 June 2014 at 04:59:08 UTC, Dan Olson wrote:
 "Temtaime" <temtaime gmail.com> writes:

 Try to specify only A.d


ldc -c A.d B.d C.d D.d
*compiles OK*
ldc -c A.d
Error: Exp type Expression not implemented: p
It dumps stack on 2.064 too. I noticed that "ldc -O2 -c A.d" and higher optimization levels work though.
The codegen crashes because semantic2() and semantic3() did not run on some functions. This can happen e.g. because of syntax errors. With my latest commit to merge-2.064 branch the crash is replaced by an error message. But I still need to analyze why LDC wants to generate code for the functions - DMD does apparently not. Regards, Kai
Jun 19 2014
next sibling parent "Temtaime" <temtaime gmail.com> writes:
Oh ok thanks you for your work.
I'll track it.
Jun 19 2014
prev sibling parent reply "Temtaime" <temtaime gmail.com> writes:
And merge this fix to 2.065 branch too please.
Jun 19 2014
parent "Kai Nacke" <kai redstar.de> writes:
On Thursday, 19 June 2014 at 11:29:17 UTC, Temtaime wrote:
 And merge this fix to 2.065 branch too please.
It is now in master (which is at 2.065 now). But this fix emits only an error message instead of a crash. It does not fix the underlying problem. Regards, Kai
Jun 25 2014
prev sibling parent reply "Temtaime" <temtaime gmail.com> writes:
Hi Kai !
Any chance to get this bug fixed ?
Jun 19 2014
next sibling parent "Kai Nacke" <kai redstar.de> writes:
On Thursday, 19 June 2014 at 11:27:32 UTC, Temtaime wrote:
 Hi Kai !
 Any chance to get this bug fixed ?
I am working on it. Root cause is that LDC emits too much code, in this case even for entities for which not all semantic passes were run. Regards, Kai
Jun 25 2014
prev sibling parent "Kai Nacke" <kai redstar.de> writes:
On Thursday, 19 June 2014 at 11:27:32 UTC, Temtaime wrote:
 Hi Kai !
 Any chance to get this bug fixed ?
(https://github.com/ldc-developers/ldc/issues/662) for it. Regards, Kai
Jul 01 2014