FW: Defect in GCC 4.4.0 bfin Port : Wrong code generated while accessing multiple arrays with different loop index variables within loop (-Os option)
Bernd Schmidt
bernds_cb1@t-online.de
Mon Oct 19 20:09:00 GMT 2009
> Consider the following test case:
>
> Test Case Reference:
> --------------------
>
> int siVect[40] ;
> int siCoeff[40] ;
> int siSumofDotProduct ;
> int siIndex1, siIndex2 ;
>
> vTestMultipleArrayAccessWithDifferentLoopIndex()
> {
> for (siIndex1=0 ; siIndex1<40 ; siIndex1++)
> {
> siSumofDotProduct += siVect[siIndex1] * siCoeff[siIndex2];
> siIndex2++;
> }
> }
This is not a complete testcase; it needs additional code to call this
function and test the result. When I added this, it produced the same
result with -O0, -O2 and -Os, hence I don't know...
>
> Assembly generated by bfin port (GCC 4.4.0 --target=bfin-elf) (-Os):
> --------------------------------------------------------------------
> P1 = 41 (X);
> LSETUP (.L3, .L6) LC1 = P1; <---- (1)
> jump.s .L2; <---- (2)
> .L3:
> R2 = [P0++];
> R3 = [P5++];
> R2 *= R3;
> R0 += 1;
> R1 = R1 + R2;
> .L2:
> R2 = P2;
> .L6:
> P2 += 1;
>
>
> Here, marked instruction (2) "jump.s" is wrongly generated along with
> hardware loop.
... what exactly you believe is wrong with this.
Bernd
--
This footer brought to you by insane German lawmakers.
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
More information about the Gcc-help
mailing list