Skip to content

Commit 7feb393

Browse files
author
Mandeep Singh Grang
authored
Fix Olden and Ptrdist benchmarks (#98)
This PR updates test files so that they compile without errors, to account for new compiler errors introduced by checkedc-clang/853. If a variable v is used in the bounds of a variable p, and v is modified without an original value, then the observed bounds of v will be unknown. This is a compiler error as of checkedc-clang/853 that occurred in two llvm test suite files.
1 parent f7d72c2 commit 7feb393

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

MultiSource/Benchmarks/Olden/em3d/make_graph.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ void make_tables(ptr<table_t> table,int groupname) {
211211

212212
void make_all_neighbors(ptr<table_t> table,int groupname) {
213213
ptr<node_t> first_node = NULL;
214-
int local_table_size;
215-
array_ptr<ptr<node_t>> local_table : count(local_table_size) = NULL;
214+
int local_table_size = 1;
215+
int local_table_bounds = local_table_size;
216+
array_ptr<ptr<node_t>> local_table : count(local_table_bounds) = NULL;
216217
array_ptr<table_arr_t> local_table_array : count(1) = NULL;
217218

218219
init_random(SEED2*groupname);
@@ -236,8 +237,9 @@ void make_all_neighbors(ptr<table_t> table,int groupname) {
236237

237238
void update_all_from_coeffs(ptr<table_t> table, int groupname)
238239
{
239-
int local_table_size;
240-
array_ptr<ptr<node_t>> local_table : count(local_table_size) = NULL;
240+
int local_table_size = 1;
241+
int local_table_bounds = local_table_size;
242+
array_ptr<ptr<node_t>> local_table : count(local_table_bounds) = NULL;
241243
ptr<node_t> first_node = NULL;
242244

243245
/* Done by do_all, table not local */
@@ -255,8 +257,9 @@ void update_all_from_coeffs(ptr<table_t> table, int groupname)
255257

256258
void fill_all_from_fields(ptr<table_t> table, int groupname)
257259
{
258-
int local_table_size;
259-
array_ptr<ptr<node_t>> local_table : count(local_table_size) = NULL;
260+
int local_table_size = 1;
261+
int local_table_bounds = local_table_size;
262+
array_ptr<ptr<node_t>> local_table : count(local_table_bounds) = NULL;
260263
ptr<node_t> first_node = NULL;
261264

262265
init_random(SEED3*groupname);
@@ -273,8 +276,9 @@ void fill_all_from_fields(ptr<table_t> table, int groupname)
273276

274277
void localize(ptr<table_t> table, int groupname)
275278
{
276-
int local_table_size;
277-
array_ptr<ptr<node_t>> local_table : count(local_table_size) = NULL;
279+
int local_table_size = 1;
280+
int local_table_bounds = local_table_size;
281+
array_ptr<ptr<node_t>> local_table : count(local_table_bounds) = NULL;
278282
ptr<node_t> first_node = NULL;
279283

280284
local_table_size = table->h_table[groupname].size;
@@ -340,7 +344,8 @@ ptr<graph_t> initialize_graph(void) {
340344
chatting("cleanup for return now\n");
341345
for (i=0; i<NumNodes; i++) {
342346
int local_table_size = table->e_table[i*blocksize].size;
343-
array_ptr<ptr<node_t>> local_table : count(local_table_size) = NULL;
347+
int local_table_bounds = local_table_size;
348+
array_ptr<ptr<node_t>> local_table : count(local_table_bounds) = NULL;
344349
_Unchecked { local_table = table->e_table[i*blocksize].table; }
345350
ptr<node_t> local_node_r = local_table[0];
346351

MultiSource/Benchmarks/Ptrdist/yacr2/vcg.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ DFSBelowVCG(_Array_ptr<nodeVCGType> VCG : count(channelNets + 1),
229229
void
230230
SCCofVCG(_Array_ptr<nodeVCGType> VCG : count(channelNets + 1),
231231
_Array_ptr<ulong> SCC : count(channelNets + 1),
232-
_Array_ptr<ulong> perSCC : count(totalSCC + 1))
232+
_Array_ptr<ulong> tmpPerSCC : count(totalSCC + 1))
233233
{
234234
ulong net;
235235
ulong scc;
@@ -241,6 +241,9 @@ SCCofVCG(_Array_ptr<nodeVCGType> VCG : count(channelNets + 1),
241241
ulongdone;
242242
;
243243

244+
ulong originalTotalSCC = totalSCC;
245+
_Array_ptr<ulong> perSCC : count(totalSCC + 1) = tmpPerSCC;
246+
244247
/*
245248
* DFS of above edges.
246249
*/

0 commit comments

Comments
 (0)