> Etienne Lorrain <[EMAIL PROTECTED]> wrote:
>
>>   Some of those problem may also exist in GCC-4.0 because this
>>  version (and the 4.1 I tested) gives me an increase of 60% of the
>>  code size compared to 3.4.3.
>
>
> This is a serious regression which should be submitted in Bugzilla. Would
> you please take care of that? It is sufficient to provide a single
> preprocessed source which shows the code size increase in compilation.
> GCC4
> still needs some tuning for -Os.
>
> Thanks!
> --
> Giovanni Bajo
>

  You probably would not like my target - part of this increase is
 probably due to the fact that some assembler instructions are
 shorter in ia32 protected mode than in ia32 real mode.

 I still tryed to extract a simple function and compile it here with
 the options I am using: -fomit-frame-pointer -march=i386 -mrtd
 -fno-builtin -funsigned-char -fverbose-asm -minline-all-stringops
 -mno-align-stringops  -Os -ffunction-sections -fstrict-aliasing
 -falign-loops=1 -falign-jumps=1 -falign-functions=2
 -mno-align-double -mpreferred-stack-boundary=2

 Here is the file:
---------------------
struct disk_interface_str {
    unsigned    nb_IDE_found;
    struct IDE_found_str {
        unsigned short  ideIOadr;
        unsigned short  ideIOctrladr;
        unsigned char   irq;
        unsigned char   bios_order;
        unsigned short  reserved;
        } *IDE_found;
    } DI;

void reorder_IDE_for_linux (void)
  {
  static const unsigned short idearray[] = {
        0x1F0, 0x170,
        0x1E8, 0x168,
        0x1E0, 0x160,
        };
  unsigned short cpt, order;

  for (order = 0; order < sizeof(idearray)/sizeof(idearray[0]); order++) {
      for (cpt = order + 1; cpt < DI.nb_IDE_found; cpt++)
          if (DI.IDE_found[cpt].ideIOadr == idearray[order])
              break;
      if (cpt < DI.nb_IDE_found) {
          struct IDE_found_str save = DI.IDE_found[cpt];
          unsigned short i;

          for (i = order; i < cpt; i++) {
              struct IDE_found_str tmp = DI.IDE_found[i];
              DI.IDE_found[i] = save;
              save = tmp;
              }
          DI.IDE_found[cpt] = save;
          }
      }
  }
---------------------
  If I compile that with GCC-3.4, I get:

$ size tmp.o
text    data     bss     dec     hex filename
 243       0       0     243      f3 tmp.o

  With GCC-4.0:

$ size tmp.o
text    data     bss     dec     hex filename
 387       0       0     387     183 tmp.o

  Can someone confirm the problem first?

  Etienne.


Reply via email to