This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: 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)
- From: Bernd Schmidt <bernds_cb1 at t-online dot de>
- To: gcc-help at gcc dot gnu dot org, meena at acmet dot com
- Date: Mon, 19 Oct 2009 16:19:26 +0100
- Subject: Re: 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)
- References: <1255497466.6127.7.camel@meena-laptop> <8A42379416420646B9BFAC9682273B6DA9E47F@limkexm3.ad.analog.com>
> 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