This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/81323] New: IPA-VRP doesn't handle return values
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 05 Jul 2017 09:55:53 +0000
- Subject: [Bug ipa/81323] New: IPA-VRP doesn't handle return values
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81323
Bug ID: 81323
Summary: IPA-VRP doesn't handle return values
Product: gcc
Version: 7.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
CC: marxin at gcc dot gnu.org
Target Milestone: ---
__attribute__((noinline)) int foo (void)
{
__builtin_printf ("foo\n");
return 3;
}
int
bar (void)
{
int x = foo ();
return x >= 2 && x <= 4;
}
Shouldn't we be able to optimize bar to foo (); return 1; with -fipa-vrp or
-fipa-cp, at least when foo binds to the current definition (-fno-pic)?
If we have a constant or a value range for the return value, can't we use that
in the callers?