aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2021-10-07 15:26:01 +0200
committerJan Hubicka <jh@suse.cz>2021-10-07 15:26:01 +0200
commit44b61586d8640b79e78cfdb6a555200ccee8df77 (patch)
tree280264cbb63b2964235bcfec1408eba79dc479dd /gcc/testsuite
parent348b426be3fc99453b42e79a18331c7bf24ee0dc (diff)
downloadgcc-44b61586d8640b79e78cfdb6a555200ccee8df77.zip
gcc-44b61586d8640b79e78cfdb6a555200ccee8df77.tar.gz
gcc-44b61586d8640b79e78cfdb6a555200ccee8df77.tar.bz2
Fix access node merging
gcc/ChangeLog: 2021-10-07 Jan Hubicka <hubicka@ucw.cz> PR ipa/102581 * ipa-modref-tree.h (modref_access_node::contains_p): Handle offsets better. (modref_access_node::try_merge_with): Add sanity check that there are no redundant entries in the list. gcc/testsuite/ChangeLog: 2021-10-07 Jan Hubicka <hubicka@ucw.cz> * g++.dg/torture/pr102581.C: New test.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.dg/torture/pr102581.C51
1 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr102581.C b/gcc/testsuite/g++.dg/torture/pr102581.C
new file mode 100644
index 0000000..7f172d0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr102581.C
@@ -0,0 +1,51 @@
+// { dg-do compile }
+/* { dg-additional-options "-fno-strict-aliasing" } */
+enum VkStructureType {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR
+} typedef VkPhysicalDeviceSparseProperties;
+struct VkPhysicalDeviceProperties {
+ int apiVersion;
+ VkPhysicalDeviceSparseProperties sparseProperties;
+};
+typedef struct {
+ VkStructureType sType;
+ int *pPhysicalDevices;
+} VkPhysicalDeviceFeatures2;
+typedef struct VkPhysicalDeviceProperties2 {
+ VkStructureType sType;
+ void *pNext;
+} VkPhysicalDeviceMemoryProperties2;
+struct VulkanVersion {
+ int major;
+ int minor;
+ int patch;
+};
+int make_vulkan_version_version;
+VulkanVersion make_vulkan_version() {
+ return {make_vulkan_version_version, make_vulkan_version_version,
+ make_vulkan_version_version};
+}
+struct AppGpu {
+ int &inst;
+ int id;
+ int *phys_device = nullptr;
+ VulkanVersion api_version{};
+ VkPhysicalDeviceProperties props{};
+ VkPhysicalDeviceProperties2 props2{};
+ int memory_props{};
+ VkPhysicalDeviceMemoryProperties2 memory_props2{};
+ int features{};
+ VkPhysicalDeviceFeatures2 features2{};
+ int *dev = nullptr;
+ int enabled_features{};
+ int AppGpu_phys_device;
+ int AppGpu_inst;
+ AppGpu() : inst(AppGpu_inst), id() {
+ api_version = make_vulkan_version();
+ props2.sType = memory_props2.sType = features2.sType =
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
+ }
+};
+int
+main() { AppGpu(); return 0; }