middle-end/93519 - avoid folding stmts in obviously unreachable code
authorRichard Biener <rguenther@suse.de>
Fri, 7 Feb 2020 11:56:18 +0000 (12:56 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 7 Feb 2020 11:57:18 +0000 (12:57 +0100)
commit3c7a03bc360c3511fae3747a71e579e9fd0824f9
tree80486aaaa38e31f6a148bf0e524ce795e12ad5b4
parent5713834e4b99e4c4c99eef15698a497f091b7dc4
middle-end/93519 - avoid folding stmts in obviously unreachable code

The inliner folds stmts delayed, the following arranges things so
to not fold stmts that are obviously not reachable to avoid warnings
from those code regions.

2020-02-07  Richard Biener  <rguenther@suse.de>

PR middle-end/93519
* tree-inline.c (fold_marked_statements): Do a PRE walk,
skipping unreachable regions.
(optimize_inline_calls): Skip folding stmts when we didn't
inline.

* gcc.dg/Wrestrict-21.c: New testcase.
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wrestrict-21.c [new file with mode: 0644]
gcc/tree-inline.c