This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Code emitted was bloated with no optimisation.


Hi Andrew,

Appreciate your  reply here and yes unoptimized code is expected to be
large ,but for the construct like a[i] the below generated code looks
crazy to me .

 ld      WA, 10
        ld      (_a+18), WA  ; a[9] = 10;

        ld      WA, (_i)     ;code bloated here for a[i]
        ld      IX, WA
        ld      BC, 15
        cal     _C87C_shris
        ld      IY, WA
        ld      DE, WA
        ld      HL, BC
        ld      WA, IX
        add     WA, IX
        ld      DE, WA
        ld      WA, DE
        ld      BC, HL
        ld      HL, 1
        ld      (SP+2), HL
        cmp     WA,IX
        j       lt,_.L2
        ld      DE, 0
        ld      (SP+2), DE
.L2:
        ld      DE, WA
        ld      HL, BC
        ld      BC, IY
        add     BC, IY
        ld      HL, BC
        ld      WA, DE
        ld      BC, HL
        ld      DE, (SP+2)
        add     DE, BC
        ld      BC, DE
        ld      HL, WA
        ld      (SP+0), HL
        ld      WA, 20
        ld      HL, (SP+0)
        ld      (a+i), WA

Anyidea why it so ??

Thank you in advance
~Umesh

On Thu, Apr 10, 2014 at 8:54 PM, Andrew Haley <aph@redhat.com> wrote:
> On 04/10/2014 04:12 PM, Umesh Kalappa wrote:
>
>> Please somebody from the group can share their thoughts and will be
>> appricate the same.
>
> But unoptimized code is expected to be large.  Why do you expect
> otherwise?
>
> Andrew.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]