Open davidmalcolm opened 7 years ago
gimplification collapses each "return" in a function so that they share one GIMPLE_RETURN e.g. {{{ if (COND1) return EXPR1; return EXPR2; }}}
to the equivalent of e.g.: {{{ if (COND1) { _retval_1 = EXPR1; goto combined_return; }
_retval_2 = EXPR2; goto combined_return;
combined_return: _retval_3 = PHI<_retval_1, _retval_2> return _retval_3; }}}
This leads to confusing control flow in reports from cpychecker where the location of the return statement appears at the end of the function, rather than where the user might reasonably expect to see it.
See e.g.: https://lists.fedorahosted.org/pipermail/gcc-python-plugin/2014-May/000375.html
Hopefully we can fix such things up so that the "return" is reported at the source location.
gimplification collapses each "return" in a function so that they share one GIMPLE_RETURN e.g. {{{ if (COND1) return EXPR1; return EXPR2; }}}
to the equivalent of e.g.: {{{ if (COND1) { _retval_1 = EXPR1; goto combined_return; }
_retval_2 = EXPR2; goto combined_return;
combined_return: _retval_3 = PHI<_retval_1, _retval_2> return _retval_3; }}}
This leads to confusing control flow in reports from cpychecker where the location of the return statement appears at the end of the function, rather than where the user might reasonably expect to see it.
See e.g.: https://lists.fedorahosted.org/pipermail/gcc-python-plugin/2014-May/000375.html
Hopefully we can fix such things up so that the "return" is reported at the source location.