Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MSVC 2017 build errors #8

Closed
wants to merge 2 commits into from
Closed

Conversation

chenm001
Copy link
Contributor

@chenm001 chenm001 commented Oct 6, 2020

  1. Crash on my non-AVX2 CPU
  2. Disable code page warning to avoid build failed (defaule level 'warning treated as error')

Environment:
  * MSVS 2017
  * Debug mode
Reason:
  * Template member function in header file will generate duplicated code;
  * There assign different CPU flag on cpp file;
  * The linker choice one of template member function that generate for
    AVX2 CPU
  * As a result, the execute was crash due to BMI2 instruction SHLX
@adamjw24
Copy link
Member

adamjw24 commented Oct 8, 2020

Concerning the crash on non-AVX2 CPUs.

This only happens in debug mode, right? This is what we observed during development. Please let me know if this also affects release/relwithdebinfo builds.

I think this is a compiler bug in MSVC rather than an issue with the software itself.

Because its actually a compiler bug, and because it only impacts debugging on older CPU's I'd say we will not be fixing it.

Thanks for providing the workaround solution.

@chenm001
Copy link
Contributor Author

chenm001 commented Oct 8, 2020

I think it is not a compiler bug, it is most probability software bugs.

As details in my patch comment, the project uses a template in header files, the compiler will be generate both SSE4 and AVX2 version for template member fucntion .max(), and the linker choice one of instance into final execute file (I guess this is eligible for C++ standards).
As a result. *_sse4.cpp will calll template member function generate by *_avx2.cpp

In Release and RelWithDebInfo mode, the compiler automatic inline these function into correct cpp files, so we can't see wrong CPU instruction across from them.

My patch exact inline these member function in Debug mode, it is workaround for old CPU.

@chenm001 chenm001 closed this Oct 15, 2020
adamjw24 added a commit to adamjw24/vvdec that referenced this pull request Mar 26, 2021
Fix poc reuse (occasional test case failures)

Closes fraunhoferhhi#8 and fraunhoferhhi#6

See merge request git/vvdec!59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants