4 Commits

4 changed files with 11 additions and 3 deletions

View File

@@ -321,6 +321,12 @@ static set<SAPFOR::BasicBlock*> analyzeLoop(LoopGraph* loop, const set<SAPFOR::B
}
}
if (currentLoop.empty()) // can't find loop IR - loop unreachable!
{
__spf_print(1, "Unreachable loop on %s:%d\n", current_file->filename(), loop_operator->lineNumber());
return currentLoop;
}
if (!head_block)
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);

View File

@@ -224,6 +224,8 @@ bool equalDims(const CommConstraint& a, const CommConstraint& b)
if (adim[i].second - adim[i].first != bdim[i].second - bdim[i].first)
return false;
}
return true;
}

View File

@@ -345,7 +345,7 @@ const set<SgSymbol*>& getModuleSymbols(SgStatement *func)
}
symbolsForFunc[func->symbol()->identifier()] = symbs;
return symbs;
return symbolsForFunc[func->symbol()->identifier()];
}
static void findSymbol(SgStatement* func, const string& varName, const string& locName,

View File

@@ -569,8 +569,8 @@ void copyIncludes(const set<string> &allIncludeFiles, const map<string, map<int,
while (!feof(oldFile))
{
char buf[8192];
char *res = fgets(buf, 16384, oldFile);
char buf[16384];
char *res = fgets(buf, sizeof(buf), oldFile);
if (res == NULL)
break;