Open Quuxplusone opened 5 years ago
Bugzilla Link | PR43007 |
Status | REOPENED |
Importance | P enhancement |
Reported by | Michael Kuklinski (mike.k@digitalcarbide.com) |
Reported on | 2019-08-15 09:56:23 -0700 |
Last modified on | 2019-11-03 16:06:50 -0800 |
Version | trunk |
Hardware | All All |
CC | david.bolvansky@gmail.com, llvm-bugs@lists.llvm.org, mike.k@digitalcarbide.com, nok.raven@gmail.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also | PR13826 |
https://reviews.llvm.org/D66096 should fix it
Code assumes(result == 1) but we dont know if
'function_returns_only_1_or_doesnt_return' has side effects or not.
With __attribute__((const)):
extern int function_returns_only_1_or_doesnt_return(int, int)
__attribute__((const));
We get what we want:
define dso_local i32 @foo1(i32 %0, i32 %1) local_unnamed_addr #0 {
ret i32 1
}
define dso_local i32 @foo2(i32 %0, i32 %1) local_unnamed_addr #0 {
ret i32 1
}
so I believe this works as expected.
Eh, but you are right about performing tail call optimization.. Reopened.
Probably duplicate of bug 13826.