middle-end/99122 - Issues with VLA parameter inlining
authorRichard Biener <rguenther@suse.de>
Thu, 18 Feb 2021 11:28:26 +0000 (12:28 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 18 Feb 2021 13:38:33 +0000 (14:38 +0100)
commit7ee164dcfe390fc030028db9112d44255637b1aa
tree977394736d876959c959abe07ea5c81028e6b03b
parenta2ef38b1f94dd108046e702ad46dcd8e9b34625e
middle-end/99122 - Issues with VLA parameter inlining

The following instructs IPA not to inline calls with VLA parameters
and adjusts inlining not to create invalid view-converted VLA
parameters on mismatch and makes the error_mark paths with debug
stmts actually work.

The first part avoids the ICEs with the testcases already.

2021-02-18  Richard Biener  <rguenther@suse.de>

PR middle-end/99122
* ipa-fnsummary.c (analyze_function_body): Set
CIF_FUNCTION_NOT_INLINABLE for VLA parameter calls.
* tree-inline.c (insert_init_debug_bind): Pass NULL for
error_mark_node values.
(force_value_to_type): Do not build V_C_Es for WITH_SIZE_EXPR
values.
(setup_one_parameter): Delay force_value_to_type until when
it's needed.

* gcc.dg/pr99122-1.c: New testcase.
* gcc.dg/pr99122-2.c: Likewise.
gcc/ipa-fnsummary.c
gcc/testsuite/gcc.dg/pr99122-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr99122-2.c [new file with mode: 0644]
gcc/tree-inline.c