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

dongkyun.s at samsung dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |---

--- Comment #7 from dongkyun.s at samsung dot com ---
> Different tuning.  Though maybe at -Os should be almost the same except for 
> the allowance for using the instructions that are in cortex-a12 rather than 
> a9 (for the -mcpu case). 
I attached .o files made by '-mtune=cortex-a9' and 'mtune=cortex-a12' (same as
-mcpu case).
Could you describe more in detail about this why memset is added on cortex-a9
or below ?

memset_test_cortex-a9.o:     file format elf32-littlearm
Disassembly of section .text:
...
00000022 <test_func>:
  22:   b51f            push    {r0, r1, r2, r3, r4, lr}
  24:   2210            movs    r2, #16
  26:   2100            movs    r1, #0
  28:   4668            mov     r0, sp
  2a:   f7ff fffe       bl      0 <memset>

> But really memset is part of the C standard here and you don't use 
> -fno-hoisting option; 
Which option do you mean? (I'm sorry, but, fno-hoisting is not found)

> Not a bug, see PR 63393 comment #5 for explanation of why.
This is not related to freestanding implementations. Again, option is different
by '-mcpu or -mtune' only.

(1) CFLAGS: -Os -mtune=cortex-a9
(CC) memset_test.o
(CC) main.o
gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-ld
-Bstatic -o memset_test \
        memset_test.o main.o \
        --start-group
-L/home/dongkyun.s/tmp/memset_test/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/6.3.1
-lgcc --end-group -Map memset_test.map #--gc-sections
memset_test.c:(.text+0x2a): undefined reference to `memset'

(2) CFLAGS: -Os -mtune=cortex-a12
(CC) memset_test.o
(CC) main.o
gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-ld
-Bstatic -o memset_test \
        memset_test.o main.o \
        --start-group
-L/home/dongkyun.s/tmp/memset_test/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/6.3.1
-lgcc --end-group -Map memset_test.map #--gc-sections
BUILD_TARGETS=memset_test.bin memset_test.txt memset_test.dis memset_test.ver
Build Done!

Reply via email to