cchen created this revision.
Herald added subscribers: cfe-commits, sstefan1, guansong, yaxunl.
Herald added a reviewer: jdoerfert.
Herald added a project: clang.
cchen added a comment.
cchen added a reviewer: ABataev.
cchen added subscribers: dreachem, sandoval.

Haven't added test yet since I'm not sure in which file should I add the test.


For the below case, Clang seems to regress (asserts) after 
https://github.com/llvm/llvm-project/commit/715f7a1bd058c64a39cc4773114dfb46ae8cc8a3

  struct FOO
  {
    static const int vec_align_bytes = 32;
  
    void foo()
    {
      alignas(vec_align_bytes) double a;
      a++;
    }
  
  };

We can avoid the assertion failure by either removing alignas or
OpenMP directive in the above code. It is apparent the usage of alignas
is resonable so the issue might be stem from OpenMP code.
In addition, replacing OpenMP directive with some arbitrary Clang directive
can avoid the assertion failure.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80590

Files:
  clang/lib/Sema/SemaOpenMP.cpp


Index: clang/lib/Sema/SemaOpenMP.cpp
===================================================================
--- clang/lib/Sema/SemaOpenMP.cpp
+++ clang/lib/Sema/SemaOpenMP.cpp
@@ -2631,6 +2631,7 @@
   DSAStack->pop();
   DiscardCleanupsInEvaluationContext();
   PopExpressionEvaluationContext();
+  CleanupVarDeclMarking();
 }
 
 static bool FinishOpenMPLinearClause(OMPLinearClause &Clause, DeclRefExpr *IV,


Index: clang/lib/Sema/SemaOpenMP.cpp
===================================================================
--- clang/lib/Sema/SemaOpenMP.cpp
+++ clang/lib/Sema/SemaOpenMP.cpp
@@ -2631,6 +2631,7 @@
   DSAStack->pop();
   DiscardCleanupsInEvaluationContext();
   PopExpressionEvaluationContext();
+  CleanupVarDeclMarking();
 }
 
 static bool FinishOpenMPLinearClause(OMPLinearClause &Clause, DeclRefExpr *IV,
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to