This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/26726] New: -fivopts producing out of bounds array refs
- From: "mueller at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Mar 2006 10:41:33 -0000
- Subject: [Bug tree-optimization/26726] New: -fivopts producing out of bounds array refs
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
=== Cut ===
struct
QValueList
{
QValueList()
{
sh = new int;
}
QValueList& operator+= ( QValueList&);
int* sh;
};
void
queryIconsByContext()
{
QValueList iconlist[8];
QValueList iconlistResult;
for (int i=0; i<8; i++)
iconlistResult+=iconlist[i];
}
=== Cut ===
g++ -O2
produces this SSA form after ivopts branch:
...
ivtmp.38_37 = ivtmp.38_1 + 4B;
if (ivtmp.38_37 != &iconlist[9]) goto <L10>; else goto <L2>;
...
taking address of the 10th iconlist element is out of bounds access.
--
Summary: -fivopts producing out of bounds array refs
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mueller at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26726