This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/86140] New: constprop clones with identical bodies
- From: "redbeard0531 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 Jun 2018 03:17:26 +0000
- Subject: [Bug middle-end/86140] New: constprop clones with identical bodies
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86140
Bug ID: 86140
Summary: constprop clones with identical bodies
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: redbeard0531 at gmail dot com
Target Milestone: ---
This was tweaked example code to demonstrate something totally unrelated, but I
noticed it was doing the constprop clone thing for functions with identical
instructions, which seemed odd. While this exact case doesn't matter, it seemed
like it might be a sign of a deeper bug.
https://godbolt.org/g/Zwpi7J
[[gnu::noinline]] void f(const int*){
asm volatile("");
}
void good() {
constexpr static int arr[1000] = {};
f(arr);
}
void bad() {
constexpr int arr[1000] = {};
f(arr);
}
f(int const*) [clone .constprop.0]:
ret
f(int const*) [clone .constprop.1]:
ret
f(int const*):
ret
good():
jmp f(int const*) [clone .constprop.0]
bad():
jmp f(int const*) [clone .constprop.1]