Fix tree-optimization/101941: IPA splitting out function with error attribute
The Linux kernel started to fail compile when the jump threader was improved
(r12-2591-g2e96b5f14e4025691). This failure was due to the IPA splitting code
decided now to split off the basic block which contained two functions,
one of those functions included the error attribute on them. This patch fixes
the problem by disallowing basic blocks from being split which contain functions
that have either the error or warning attribute on them.
The two new testcases are to make sure we still split the function for other
places if we reject the one case.
Committed as approved after Bootstrapped and tested on x86_64-linux-gnu with no regressions.
PR tree-optimization/101941
gcc/ChangeLog:
* ipa-split.cc (visit_bb): Disallow function calls where
the function has either error or warning attribute.
gcc/testsuite/ChangeLog:
* gcc.c-torture/compile/pr101941-1.c: New test.
* gcc.dg/tree-ssa/pr101941-1.c: New test.