Comment #0 by dlang-bugzilla — 2015-02-02T15:27:09Z
If you build a 64-bit dmd.exe from git master with Visual Studio, Phobos doesn't build any more. I get an error inside unicode_tables.d.
Here's a reduced test case:
///////// test.d ////////
struct FullCaseEntry
{
dchar[3] seq;
auto value() return
{
return seq[0..1];
}
}
/////////////////////////
Compiler output:
test.d(5): Error: function declaration without return type. (Note that constructors are always named 'this')
test.d(6): Error: no identifier for declarator value()return
Miraculously, it's fixed if "return" is replaced with "@return".
Sounds like an uninitialized variable?
Comment #1 by bugzilla — 2015-02-06T03:22:15Z
I tried it and it works with the DMC build DMD. Looks like the VS C++ compiler has a bug in it!
Does VS have any valgrind-like feature you can try?
Comment #2 by bugzilla — 2015-02-22T07:35:57Z
I also ran valgrind on 64 bit dmd compiling test.d on Linux. No memory corruption was detected.
Comment #3 by code — 2015-02-22T13:55:31Z
Valdimir can you give more information please? If I build dmd git head with Visual Studio 2013 your test case does not fail. It works both with a debug and release dmd compiled in 64-bit. Which Visual Studio Version are you using? Does it happen both in release and debug?
Comment #4 by dlang-bugzilla — 2015-03-04T04:33:06Z
(In reply to Benjamin Thaut from comment #3)
> Valdimir can you give more information please? If I build dmd git head with
> Visual Studio 2013 your test case does not fail. It works both with a debug
> and release dmd compiled in 64-bit. Which Visual Studio Version are you
> using? Does it happen both in release and debug?
That's strange. I can reproduce the problem after I build DMD with the "Release" configuration and "x64" platform with either VS2010 or VS2013.
Here is the dmd.exe I get, does it happen on your system?
http://dump.thecybershadow.net/3b481e0ae99981873edc3c0f5f7f158a/dmd.exe
Comment #5 by code — 2015-03-05T15:57:53Z
When you build with vs2013 do you upgrade the solution to the 2013 compiler first? Or do you simply build it using the vs2010 compiler?
Comment #6 by dlang-bugzilla — 2015-03-05T20:13:12Z
I build it with the VS2010 compiler (from the command line).
Here are my build commands:
set PATH=C:\Soft\dm\bin;%WINDIR%\System32;C:\Soft\Tools
set PATH=%PATH%;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat"
msbuild /p:Configuration=Release /p:Platform=x64 dmd_msc_vs10.sln
if errorlevel 1 exit 1
copy /y vcbuild\x64\Release\dmd_msc.exe dmd.exe
copy /y vcbuild\x64\Release\dmd_msc.pdb dmd.pdb
Comment #7 by r.sagitario — 2015-03-20T13:44:11Z
Building with VS2013 works for me, too, but I don't have the VS2010 toolset installed. Your prebuilt binary fails on my system aswell.
Does it help to switch the "Platform Toolset" to v120?
Comment #8 by dlang-bugzilla — 2015-03-20T13:48:33Z
Well, actually, the regression doesn't happen for me any more with latest master. I suppose I could bisect it if someone is very curious, but I don't look forward doing it by hand since Digger doesn't build DMD with VS.