=== 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

Reply via email to