[Bug tree-optimization/59892] out of bounds array access is misoptimized
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 20 18:47:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59892
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |trippels at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
struct isci_host;
struct isci_orom;
struct isci_pci_info {
struct isci_host *hosts[2];
struct isci_orom *orom;
} v = {{(struct isci_host *)1,(struct isci_host *)1}, 0};
int printf(const char *fmt, ...);
int isci_pci_probe()
{
int i;
struct isci_host *isci_host;
for (i = 0, isci_host = v.hosts[i];
i < 2 && isci_host;
isci_host = v.hosts[++i]) {
printf("(%d < %d) == %d\n", i, 2, (i < 2));
}
return 0;
}
int main()
{
isci_pci_probe();
}
When v.hosts[0] or v.hosts[1] is NULL the loop is fine, so there is
no reason for a warning.
The testcase is obviously invalid.
More information about the Gcc-bugs
mailing list