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

DXASSERT condition for failed template specialization needs amending #6615

Open
tcorringham opened this issue May 13, 2024 · 0 comments
Open
Assignees
Labels
bug Bug, regression, crash
Milestone

Comments

@tcorringham
Copy link
Collaborator

Description
A large codebase that is successfully compiled in many projects sometimes triggers a DXASSERT when specializing a template type - with no reason being apparent.

Steps to Reproduce
// bug.hlsl - a very artificial example that illustrates the issue
float a;
#include "a.h" // include file doesn't exist - this should produce an fatal error diagnostic
void b() {};
int3 c(int X)
{
return X.xxx; // assert triggered if include file a.h doesn't exist, compilation succeeds if it does
}
// dxc -T lib_6_8 bug.hlsl

Actual Behavior
An investigation revealed the DXASSERT was only triggered if there was some error detected earlier in the compilation - e.g. an include file is not found.
Clang suppresses template specialization if a fatal error has been reported in order to avoid the risk of a cascade of secondary error diagnostics from a failed specialization.
The DXASSERTs only check for a failed specialization, without allowing for the failure being due to an earlier unrelated fatal error - this has the unintended result of hiding the fatal error, and providing no indication of what the problem is.

The DXASSERTs should not trigger if a fatal error has been registered.

Environment

  • DXC version :libdxcompiler.so: 1.8(dev;4588-f6d17595)
  • Host Operating System : Any
@tcorringham tcorringham added bug Bug, regression, crash needs-triage Awaiting triage labels May 13, 2024
@tcorringham tcorringham self-assigned this May 13, 2024
@damyanp damyanp removed the needs-triage Awaiting triage label May 13, 2024
@damyanp damyanp added this to the Dormant milestone May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash
Projects
Status: Triaged
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants