https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84658
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot
gnu.org
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Yes, it's cpp2 that removes the check, IPA inlining is not needed:
$ cat ~/Programming/testcases/pr84658.cpp
#include <stdio.h>
const int kTestCasesFoo[] = { 0, 1, 2, 3, 4, 5, 8, 15, 16, 17, 512, 1020, 1021,
1022, 1023, 1024 };
const int kTestCasesBar[] = { 0, 1, 2, 3, 4, 5, 8, 15, 16, 17, 512, 1020, 1021,
1022, 1023, 1024 };
void Foo() {
for (int count : kTestCasesFoo) {
printf("foo: %d\n", count);
}
}
void Bar() {
for (int count : kTestCasesBar) {
printf("bar: %d\n", count);
}
}
int main() {
Foo();
Bar();
}
$ ./xg++ -B. ~/Programming/testcases/pr84658.cpp -O2 -fno-ipa-icf-functions
-fmerge-all-constants -c -fno-inline