Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Clang-CL freezes compiling C++ file with OpenMP enabled #37669

Closed Quuxplusone closed 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR38696
Status RESOLVED WORKSFORME
Importance P normal
Reported by Niklas Rosenstein (rosensteinniklas@gmail.com)
Reported on 2018-08-24 16:47:24 -0700
Last modified on 2018-08-30 08:33:47 -0700
Version trunk
Hardware PC Windows NT
CC a.bataev@hotmail.com, hans@chromium.org, hfinkel@anl.gov, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments bugreport.zip (498729 bytes, application/x-zip-compressed)
TexturePack.p.cpp.zip (549364 bytes, application/x-zip-compressed)
Blocks
Blocked by
See also

Clang-CL freezes compiling the attached TexturePack.cpp file, but only with OpenMP enabled. I'm using LLVM for Windows with clang 8.0.0 (trunk) and MSVC 2017 19.14.26433.

The attached archive has all the necessary source files. I also provide a buildlog.txt and a Python script (run.py) which you can use to run the command on your machine (adjusts some paths and sets up the environment for Clang-CL).

The script makes some assumptions, eg. on the Visual Studio 2017 version. You may need to exchange the "Professional" in the vcvarsall string with whatever VS version you are using. It also assume LLVM is installed under C:\Program Files\LLVM.

This is my first time submitting a bug report to LLVM -- please let me know if you need any more information.

Quuxplusone commented 6 years ago

Attached bugreport.zip (498729 bytes, application/x-zip-compressed): Source files, buildlog and run.py Script

Quuxplusone commented 6 years ago

I just tried with clang built from r340725, and that doesn't hang for me.

I used this invocation:

clang-cl src\TexturePack.cpp /c /Foa.obj /Ivendor\effolkronium\random\include /Ivendor\NiklasRosenstein\openfx-cpp\include /Ivendor\NiklasRosenstein\opengl-cpp\include /Ivendor\NiklasRosenstein\nr.utils\include /Ivendor\TeamHypersomnia /Ivendor\thinks\poisson-disk-sampling\include /Ibuild\debug.source-downloads\SFML-2.4.2-windows-vc14-64-bit\SFML-2.4.2\include /Ibuild\debug.source-downloads\glew-2.1.0-win32\glew-2.1.0\include /Ivendor\NiklasRosenstein\openfx-headers\include\1.4 /Ibuild\debug\aixterior-plugins\plugin\cxx.embed /DSFML_STATIC /DGLEW_STATIC /DWIN64 /DDEBUG /D_DEBUG -Xclang -fopenmp /EHsc /GR /Od /RTC1 /FC /FS /Z7 /wd4100 /MDd /std:c++latest

Maybe it got fixed? What revision of clang were you using?

Quuxplusone commented 6 years ago
How can I check the exact clang release? Using clang --version just gives me

  $ /c/Program\ Files/LLVM/bin/clang --version
  clang version 8.0.0 (trunk)
  Target: x86_64-pc-windows-msvc
  Thread model: posix
  InstalledDir: C:\Program Files\LLVM\bin

I downloaded the Windows x64 Installer maybe a week ago from
http://releases.llvm.org/download.html

---

Unfortunately trying to compile with Clang+MSVC 2015 doesn't work because of
missing <optional> and <variant> in its standard library.

What is the CL version of your MSVC 2017 installation?

---

Also, just to be sure, you didn't wait longer than 10 minutes for it to
complete right? Because I tried waiting for 10 minutes before I decided it must
have frozen.
Quuxplusone commented 6 years ago

Hi Niklas, could you attach preprocessed source code?

Quuxplusone commented 6 years ago

Attached TexturePack.p.cpp.zip (549364 bytes, application/x-zip-compressed): Preprocessed TexturePack.cpp

Quuxplusone commented 6 years ago

Also tried to compile the reproducer with the latest trunk and was unable to reproduce, the code compiled correctly and I did not see any problems with it.