lpcware

LPCXpresso 7.3 Assembler generates increased code size

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by MikeSimmonds on Sun Aug 17 15:07:04 MST 2014
The assembler included in 7.3 generates larger code for the same source file with the same options than that
which was included in 6.02.

The root cause seems to be where a forward branch to a label marked as a thumb function is now generating
a wide branch where it used to generate a narrow branch. But not always!

I have tried to find a changelog on the net to see if this behaviour is documented but I failed.
I tried to see if there is a (new?) assembler switch to correct the problem but again I failed.

As I understand things, the "C" compiler generates assembler code that is passed to the assembler,
so this is a problem that will affect all users, not just those who write assembler directly.

Given that branches are very common, this would apear to be a serious backward step.

Examples:

New Assembler [2.23]
00002466 EnableIRQ:
    2466:f45f 7380 movs.wr3, #256; 0x100
    246a:f000 b804 b.w2476 <EnableDisable>             WIDE Branch

0000246e DisableIRQ:
    246e:f45f 73c0 movs.wr3, #384; 0x180
    2472:f000 b800 b.w2476 <EnableDisable>           WIDE Branch

00002476 EnableDisable:
    2476:282a      cmpr0, #42; 0x2a
    2478:d20a      bcs.n2490 <EnableDisable+0x1a>
    247a:f113 23e0 adds.wr3, r3, #3758153728; 0xe000e000
    247e:2820      cmpr0, #32

But see here

00002220 ClkSet:
    2220:2078      movsr0, #120; 0x78
    2222:e7ff      b.n2224 <ClkSetup>                  NARROW Branch

00002224 ClkSetup:
    2224:4b39      ldrr3, [pc, #228]; (230c <Pool>)
    2226:2220      movsr2, #32
    2228:f8d3 11a0 ldr.wr1, [r3, #416]; 0x1a0
    222c:4311      orrsr1, r2


Old Assembler [2.21]
00002466 EnableIRQ:
    2466:f45f 7380 movs.wr3, #256; 0x100
    246a:e002      b.n2472 <EnableDisable>                NARROW Branch

0000246c DisableIRQ:
    246c:f45f 73c0 movs.wr3, #384; 0x180
    2470:e7ff      b.n2472 <EnableDisable>             NARROW Branch

00002472 EnableDisable:
    2472:282a      cmpr0, #42; 0x2a
    2474:d20a      bcs.n248c <EnableDisable+0x1a>
    2476:f113 23e0 adds.wr3, r3, #3758153728; 0xe000e000
    247a:2820      cmpr0, #32

But Again

00002220 ClkSet:
    2220:2078      movsr0, #120; 0x78
    2222:e7ff      b.n2224 <ClkSetup>                NARROW Branch

00002224 ClkSetup:
    2224:4b39      ldrr3, [pc, #228]; (230c <Pool>)
    2226:2220      movsr2, #32
    2228:f8d3 11a0 ldr.wr1, [r3, #416]; 0x1a0
    222c:4311      orrsr1, r2
    222e:f8c3 11a0 str.wr1, [r3, #416]; 0x1a0


I really need a resolution for this, but if one is not forth comming in the near time,
is it acceptable to copy the entire 'tools' directory structure from 6.02 to 7.3?

Regards, Mike

Outcomes