Closed vries closed 5 years ago
AFAIU, the CpyCheckerGimplePass is supposed to run before rewriting gimple into SSA:
# Register our GCC passes:
gimple_ps = CpyCheckerGimplePass(**kwargs)
if 1:
# non-SSA version:
gimple_ps.register_before('*warn_function_return')
However, gcc 7 introduces an ssa-name (for call arguments that are calls themselves), so in fact CpyCheckerGimplePass can encounter ssa-names.
This cause a problem in refcounts verifying, when trying to determine the Region for an ssa-name, which has expr.var == None:
def eval_lvalue(self, expr, loc):
...
if isinstance(expr, gcc.SsaName):
region = self.var_region(expr.var)
check_isinstance(region, Region)
return region
Hmm, this could be the gcc-with-cpychecker version of:
# absinterp and thus the refcount-checker have bit-rotted:
if GCC_VERSION >= 7000:
exclude_tests_below('tests/cpychecker/absinterp')
exclude_tests_below('tests/cpychecker/refcounts')
This ( https://github.com/davidmalcolm/gcc-python-plugin/pull/135 ) pull request runs the demo by default.
It ( https://travis-ci.org/davidmalcolm/gcc-python-plugin/builds/435599205?utm_source=github_status&utm_medium=notification ) fails for gcc-7 and gcc-8, but passes before gcc-6 and earlier.
Fixed (well, worked around) in pull request ( https://github.com/davidmalcolm/gcc-python-plugin/pull/139 ) , by disabling verify_refcounting for gcc-7 and later.
Fix (https://github.com/davidmalcolm/gcc-python-plugin/pull/140, "libcpychecker: Switch off verify_refcounting for gcc-7 and later") merged into master.
Closing issue.
Thanks for investigating this.
With the master branch, and patch "gcc-with-cpychecker: Add CC_FOR_CPYCHECKER", I run make demo, and run into