This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/54937] New: Invalid loop bound estimate
- From: "hubicka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Oct 2012 23:41:18 +0000
- Subject: [Bug tree-optimization/54937] New: Invalid loop bound estimate
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54937
Bug #: 54937
Summary: Invalid loop bound estimate
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hubicka@gcc.gnu.org
The following loop gets predicted incorrectly to have 0 iterations while, it
iterates once.
void exit (int);
void abort (void);
int a[1];
void (*terminate_me)(int);
__attribute__((noinline,noclone))
t(int c)
{ int i;
for (i=0;i<c;i++)
{
if (i)
terminate_me(0);
a[i]=0;
}
}
main()
{
terminate_me = exit;
t(100);
abort();
}