More exactly, this series let sparse to generate valid IR even in the case when a return statement is missing. And by 'valid IR' it's very much about phi-nodes having as much operands as there is paths reaching the exit basic-block. This series is available for testing & review in the Git repository at: git://github.com/lucvoo/sparse-dev.git missing-return ---------------------------------------------------------------- Luc Van Oostenryck (11): add linearization as a pass add testcases for missing return in last block use a temp var for function's upper-level statement topasm: top-level asm is special specialize linearize_compound_statement() there is always an active BB after linearize_fn_statement() the return BB is never terminated extract add_return() from linearize_return() use UNDEF for missing returns use a temp var for the return type/symbol return nothing only in void functions Documentation/dev-options.rst | 1 + lib.c | 1 + linearize.c | 92 +++++++++++++++++++++------------- sparse.c | 2 +- validation/{ => linear}/asm-toplevel.c | 0 validation/linear/missing-return0.c | 10 ++++ validation/linear/missing-return1.c | 15 ++++++ validation/linear/missing-return2.c | 11 ++++ validation/linear/missing-return3.c | 18 +++++++ validation/linear/missing-return4.c | 14 ++++++ validation/linear/missing-return5.c | 23 +++++++++ 11 files changed, 152 insertions(+), 35 deletions(-) rename validation/{ => linear}/asm-toplevel.c (100%) create mode 100644 validation/linear/missing-return0.c create mode 100644 validation/linear/missing-return1.c create mode 100644 validation/linear/missing-return2.c create mode 100644 validation/linear/missing-return3.c create mode 100644 validation/linear/missing-return4.c create mode 100644 validation/linear/missing-return5.c