42 lines
1.9 KiB
Diff
42 lines
1.9 KiB
Diff
From 1a2836f9dcd00d8666acf33cbbf0ba58c821676b Mon Sep 17 00:00:00 2001
|
|
From: d00573793 <dingguangya1@huawei.com>
|
|
Date: Fri, 24 Mar 2023 17:35:51 +0800
|
|
Subject: [PATCH] [Pin-gcc-client] Fix TreeToValue-VAR_DECL and
|
|
ARRAY_TYPE-getDomainIndex
|
|
|
|
|
|
diff --git a/lib/Translate/GimpleToPluginOps.cpp b/lib/Translate/GimpleToPluginOps.cpp
|
|
index d1b8319..80d4e87 100644
|
|
--- a/lib/Translate/GimpleToPluginOps.cpp
|
|
+++ b/lib/Translate/GimpleToPluginOps.cpp
|
|
@@ -1601,7 +1601,9 @@ Value GimpleToPluginOps::TreeToValue(uint64_t treeId)
|
|
bool addressable = TREE_ADDRESSABLE(t);
|
|
bool used = TREE_USED(t);
|
|
int32_t uid = DECL_UID(t);
|
|
- mlir::Value initial = TreeToValue((uint64_t)DECL_INITIAL(t));
|
|
+ // Fixme: DECL_INITIAL(t) This function causes a memory access error after repeated TreeToValue iterations.
|
|
+ // postgresql-11.3 ICE
|
|
+ mlir::Value initial = builder.create<PlaceholderOp>(builder.getUnknownLoc(), 0, IDefineCode::UNDEF, 0, rPluginType);
|
|
mlir::Value name = TreeToValue((uint64_t)DECL_NAME(t));
|
|
llvm::Optional<uint64_t> chain = (uint64_t)DECL_CHAIN(t);
|
|
GetTreeAttr(treeId, readOnly, rPluginType);
|
|
diff --git a/lib/Translate/TypeTranslation.cpp b/lib/Translate/TypeTranslation.cpp
|
|
index 8a0a674..e18f7f5 100644
|
|
--- a/lib/Translate/TypeTranslation.cpp
|
|
+++ b/lib/Translate/TypeTranslation.cpp
|
|
@@ -81,7 +81,10 @@ private:
|
|
|
|
unsigned getDomainIndex (tree type)
|
|
{
|
|
- if (TYPE_DOMAIN(type) && TYPE_MAX_VALUE(TYPE_DOMAIN(type)))
|
|
+ if (TYPE_DOMAIN(type) && TYPE_MAX_VALUE(TYPE_DOMAIN(type))
|
|
+ && TYPE_MIN_VALUE(TYPE_DOMAIN(type))
|
|
+ && TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) == INTEGER_CST
|
|
+ && TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) == INTEGER_CST)
|
|
return tree_to_shwi(TYPE_MAX_VALUE(TYPE_DOMAIN(type)))+1;
|
|
return 0;
|
|
}
|
|
--
|
|
2.33.0
|
|
|