https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78709

            Bug ID: 78709
           Summary: Code size is bigger at -Os than at -O3
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: erika.molnar at cyberthorstudios dot com
  Target Milestone: ---

Created attachment 40275
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40275&action=edit
Build steps

Hello,

I've built gcc-6.2 using the RX target on Ubuntu 14.04, 64-bit. (I will attach
the exact build configurations I've used, in build.txt). When using:

**** memcpy_restrict.c ****

#include "string.h"
void *memcpy (void * __restrict__ s1, const void * __restrict__ s2, size_t n)
{

char *dst = (char *) s1;
char *src = (char *) s2;

char *v = s1;

while (n--)
  {
    *dst++ = *src++;
  }

return v;

} 

int main ()
{
   char *a;
   char *b;
   int n;
   memcpy (a, b, n);
   return 0;
}

**** END ****

$ rx-elf-gcc memcpy_restrict.c -S -O3/-Os 

The code generated by -O3 is smaller.
Can you please explain why? 

__
Thank you,
Erika Molnar

Reply via email to