프로그램 사용/gcc2026. 6. 10. 12:06

msvc의 md 옵션과는 의미가 다르고(claude에게 낚임!)

그냥 빌드시 디버깅용 플래그라고 해야하나..?

동적 링크시 어떤 파일을 참조하는지 .d 파일에 주로 쓰도록 하는 것 같다.

[링크 : https://dmake.tistory.com/26]

[링크 : https://m.blog.naver.com/wonmylover/220771036728]

 

-M
Instead of outputting the result of preprocessing, output a rule suitable for make describing the dependencies of the main source file. The preprocessor outputs one make rule containing the object file name for that source file, a colon, and the names of all the included files, including those coming from -include or -imacros command line options.

Unless specified explicitly (with -MT or -MQ), the object file name consists of the name of the source file with any suffix replaced with object file suffix and with any leading directory parts removed. If there are many included files then the rule is split into several lines using \-newline. The rule has no commands.
This option does not suppress the preprocessor's debug output, such as -dM. To avoid mixing such debug output with the dependency rules you should explicitly specify the dependency output file with -MF, or use an environment variable like DEPENDENCIES_OUTPUT . Debug output will still be sent to the regular output stream as normal.

Passing -M to the driver implies -E, and suppresses warnings with an implicit -w.

-MM
Like -M but do not mention header files that are found in system header directories, nor header files that are included, directly or indirectly, from such a header.

This implies that the choice of angle brackets or double quotes in an #include directive does not in itself determine whether that header will appear in -MM dependency output. This is a slight change in semantics from GCC versions 3.0 and earlier.
-MF file
When used with -M or -MM, specifies a file to write the dependencies to. If no -MF switch is given the preprocessor sends the rules to the same place it would have sent preprocessed output.
When used with the driver options -MD or -MMD, -MF overrides the default dependency output file.

-MG
In conjunction with an option such as -M requesting dependency generation, -MG assumes missing header files are generated files and adds them to the dependency list without raising an error. The dependency filename is taken directly from the "#include" directive without prepending any path. -MG also suppresses preprocessed output, as a missing header file renders this useless.

This feature is used in automatic updating of makefiles.
-MP
This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing. These dummy rules work around errors make gives if you remove header files without updating the Makefile to match.

This is typical output:
test.o: test.c test.h

test.h:
-MT target
Change the target of the rule emitted by dependency generation. By default CPP takes the name of the main input file, deletes any directory components and any file suffix such as .c, and appends the platform's usual object suffix. The result is the target.
An -MT option will set the target to be exactly the string you specify. If you want multiple targets, you can specify them as a single argument to -MT, or use multiple -MT options.

For example, -MT '$(objpfx)foo.o' might give

$(objpfx)foo.o: foo.c
-MQ target
Same as -MT, but it quotes any characters which are special to Make. -MQ '$(objpfx)foo.o' gives
$$(objpfx)foo.o: foo.c
The default target is automatically quoted, as if it were given with -MQ.
-MD
-MD is equivalent to -M -MF file, except that -E is not implied. The driver determines file based on whether an -o option is given. If it is, the driver uses its argument but with a suffix of .d, otherwise it takes the name of the input file, removes any directory components and suffix, and applies a .d suffix.

If -MD is used in conjunction with -E, any -o switch is understood to specify the dependency output file, but if used without -E, each -o is understood to specify a target object file.
Since -E is not implied, -MD can be used to generate a dependency output file as a side-effect of the compilation process.

-MMD
Like -MD except mention only user header files, not system header files.

[링크 : https://linux.die.net/man/1/gcc]

Posted by 구차니
프로그램 사용/gcc2026. 6. 10. 11:57

리눅스에서 gcc로 빌드하면 시스템 절대 경로라고 해야하나.

아래의 경우, /lib/x86_64-linux-gnu/ 의 경로에 있는 so들을 보도록 되어있는데 (LD_LIBRARY_PATH)

이걸 빌드 시에 위치 기준 상대 경로를 보게 하는 옵션 인듯.

so 파일과 실행파일을 같이 배포할때 쓰이려나?

 

$ ldd untitled
linux-vdso.so.1 (0x00007fff3f7a7000)
libQt5Widgets.so.5 => /lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007a58ffe00000)
libQt5Gui.so.5 => /lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007a58ff600000)
libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007a58ff000000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007a58fec00000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007a5900f63000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007a58fe800000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007a5900519000)
libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007a58ffd79000)
libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007a59004de000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007a5900f45000)
libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007a58fef31000)
libmd4c.so.0 => /lib/x86_64-linux-gnu/libmd4c.so.0 (0x00007a59004cc000)
libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007a58ffd64000)
libicui18n.so.70 => /lib/x86_64-linux-gnu/libicui18n.so.70 (0x00007a58fe400000)
libicuuc.so.70 => /lib/x86_64-linux-gnu/libicuuc.so.70 (0x00007a58fe205000)
libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007a58ff576000)
libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007a58fee62000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007a58feac5000)
/lib64/ld-linux-x86-64.so.2 (0x00007a5900faa000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007a58fe747000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007a58ffd30000)
libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007a58fe13d000)
libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007a58ffd09000)
libicudata.so.70 => /lib/x86_64-linux-gnu/libicudata.so.70 (0x00007a58fc400000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007a58fea4f000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007a58fc2c0000)
libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007a58ffcfb000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007a58fee38000)
libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007a58fea2c000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007a5900f37000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007a59004c4000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007a58ffce3000)
libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007a58ff569000)

 

[링크 : https://velog.io/@wjddms206/RPATH-한번에-이해하기]

[링크 : https://stackoverflow.com/questions/6324131/rpath-origin-not-having-desired-effect]

[링크 : https://stackoverflow.com/questions/38058041/correct-usage-of-rpath-relative-vs-absolute]

[링크 : https://stackoverflow.com/questions/38058041/correct-usage-of-rpath-relative-vs-absolute]

Posted by 구차니
프로그램 사용/gcc2026. 3. 13. 15:33

링커 스크립트에서 만든 변수를

c에서 끌어오려면 extern 을 해주면 계산된 값이 불려온다.

 

SECTIONS
{
    /* Starts at LOADER_ADDR. */
    . = 0x80000;
    /* For AArch64, use . = 0x80000; */
    __start = .;
    __text_start = .;
    .text :
    {
        KEEP(*(.text.boot))
        *(.text)
    }
    . = ALIGN(4096); /* align to page size */
    __text_end = .;

    __bss_start = .;
    .bss :
    {
        bss = .;
        *(.bss)
    }
    . = ALIGN(4096); /* align to page size */
    __bss_end = .;
    __bss_size = __bss_end - __bss_start;
    __end = .;
}
: 저 변수들은 실제 저안에서 사용된다기 보다는 소스 코드(C 파일 혹은 어셈블리어 파일)상에서 사용되면서 의미가 부여된다. 저 변수들을 소스 코드상에서 불러 오려면 어떻게 해야 할까? 아래의 코드를 보자.

extern unsgined char __text_start
uint8_t *text_start = &__text_start;

+
extern usigned int __bss_size;

[링크 : https://yohda.tistory.com/entry/LINUXBUILD-링커스크립트]

[링크 : https://gustorage.tistory.com/27]

Posted by 구차니
프로그램 사용/gcc2026. 3. 12. 14:00

쉘에서 괄호를 벗겨 버리는군 -_-

소스는 아래

$ cat t.c
//#include <stdio.h>
void main()
{
printf("%c\r\n", 'a');
printf("%c\r\n", STR);
}

 

명령어 별 변환

실패

$ gcc -E -DSTR=b t.c
$ gcc -E -DSTR='b' t.c
$ gcc -E -DSTR="b" t.c
# 0 "t.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "t.c"

void main()
{
 printf("%c\r\n", 'a');
 printf("%c\r\n", b);
}

 

성공

$ gcc -E "-DSTR='b'" t.c
$ gcc -E -DSTR=\'b\' t.c
# 0 "t.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "t.c"

void main()
{
 printf("%c\r\n", 'a');
 printf("%c\r\n", 'b');
}

 

 

그나저나 stm32cubeide 에서 추가하니

 

컴파일시에 아래처럼 표시된다. 어우.. 이거 윈도우에서 문제 안생기려나?

 '-DSTR='"'"'A'"'"''

 

Posted by 구차니
프로그램 사용/gcc2026. 2. 18. 22:22

gcc 로 빌드하면 현재 빌드하는 시스템이 c가 아닌 cpp 라는걸 확인하기 위해(혹은 알려주기 위해)

__cplusplus 라는 선언을 -D__cplusplus 하듯 붙여주는 듯 한데

__cplusplus__가 아니라 왜 앞에만 언더바 두 개 일까.. -_-?

 

__STDC__
In normal operation, this macro expands to the constant 1, to signify that this compiler conforms to ISO Standard C. If GNU CPP is used with a compiler other than GCC, this is not necessarily true; however, the preprocessor always conforms to the standard unless the -traditional-cpp option is used.

This macro is not defined if the -traditional-cpp option is used.

On some hosts, the system compiler uses a different convention, where __STDC__ is normally 0, but is 1 if the user specifies strict conformance to the C Standard. CPP follows the host convention when processing system header files, but when processing user files __STDC__ is always 1. This has been reported to cause problems; for instance, some versions of Solaris provide X Windows headers that expect __STDC__ to be either undefined or 1. See Invocation.

__STDC_VERSION__
This macro expands to the C Standard’s version number, a long integer constant of the form yyyymmL where yyyy and mm are the year and month of the Standard version. This signifies which version of the C Standard the compiler conforms to. Like __STDC__, this is not necessarily accurate for the entire implementation, unless GNU CPP is being used with GCC.

The value 199409L signifies the 1989 C standard as amended in 1994, which is the current default; the value 199901L signifies the 1999 revision of the C standard; the value 201112L signifies the 2011 revision of the C standard; the value 201710L signifies the 2017 revision of the C standard (which is otherwise identical to the 2011 version apart from correction of defects). The value 202311L is used for the -std=c23 and -std=gnu23 modes. An unspecified value larger than 202311L is used for the experimental -std=c2y and -std=gnu2y modes.

This macro is not defined if the -traditional-cpp option is used, nor when compiling C++ or Objective-C.

__STDC_HOSTED__
This macro is defined, with value 1, if the compiler’s target is a hosted environment. A hosted environment has the complete facilities of the standard C library available.

__cplusplus
This macro is defined when the C++ compiler is in use. You can use __cplusplus to test whether a header is compiled by a C compiler or a C++ compiler. This macro is similar to __STDC_VERSION__, in that it expands to a version number. Depending on the language standard selected, the value of the macro is 199711L for the 1998 C++ standard, 201103L for the 2011 C++ standard, 201402L for the 2014 C++ standard, 201703L for the 2017 C++ standard, 202002L for the 2020 C++ standard, 202302L for the 2023 C++ standard, or an unspecified value strictly larger than 202302L for the experimental languages enabled by -std=c++26 and -std=gnu++26.

__OBJC__
This macro is defined, with value 1, when the Objective-C compiler is in use. You can use __OBJC__ to test whether a header is compiled by a C compiler or an Objective-C compiler.

__ASSEMBLER__
This macro is defined with value 1 when preprocessing assembly language.

[링크 : https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html]

 

 Version    __cplusplus
  4.8.3       201300L
  4.9.2       201300L
  5.1.0       201402L

[링크 : https://stackoverflow.com/questions/30995705/cplusplus-201402l-return-true-in-gcc-even-when-i-specified-std-c14[

Posted by 구차니
프로그램 사용/gcc2026. 1. 29. 16:38

weak는 약한 애라 강한애가 오면 치환당한다.

tt.c 에는 a()함수가 weak로 존재하고

$ cat tt.c 
#include <stdio.h>

__attribute__((weak)) void a() { printf("a\n"); }

void main()
{
a();
}

 

t2.c에는 weak가 아닌 동일 이름의 함수가 있는데

$ cat t2.c 
#include <stdio.h>

void a() { printf("b\n"); }

 

tt.c를 빌드해서 실행하면 weak 함수가 실행되서 a가 나오고

$ gcc tt.c 
$ ./a.out 
a

 

두개를 한번에 넣어서 빌드하고 실행하면 weak가 밀려나서 링크 시에는 strong이 붙어 b가 나오게 된다.

$ gcc tt.c t2.c 
$ ./a.out 
b

 

 

---

링커에서 처리하는거라 컴파일 단계에서 단일 파일에 있다면 중복 선언으로 에러가 발생하니 반드시 파일을 분리해야 한다.

$ cat tt.c 
#include <stdio.h>

__attribute__((weak)) void a() { printf("a\n"); }
void a() { printf("b\n"); }

void main()
{
a();
}

$ gcc tt.c 
tt.c:4:6: error: redefinition of ‘a’
    4 | void a() { printf("b\n"); }
      |      ^
tt.c:3:28: note: previous definition of ‘a’ with type ‘void()’
    3 | __attribute__((weak)) void a() { printf("a\n"); }
      |                            ^

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc -D 를 이용하여 명령줄에서 define 하기  (0) 2026.03.12
gcc __cplusplus 선언  (0) 2026.02.18
gcc cortex-a9 double형 neon 연산 가속  (3) 2023.08.08
gcc tree vectorize  (0) 2023.01.26
gcc fstack-protector-strong  (0) 2022.12.06
Posted by 구차니
프로그램 사용/gcc2023. 8. 8. 11:17

문득 cpu 사양 다시 볼까? 싶어서 보니

어? NEON이 아니라 NEON MPE?

NEON™ media-processing engine
Single and double precision Vector Floating Point Unit (VFPU)

[링크 : https://docs.xilinx.com/v/u/en-US/ds190-Zynq-7000-Overview]

 

그래서 cortex-A9 NEON MPE 명령을 뒤져보는데

VADD나 VSUB VMUL VDIV에 대해서 찾아보니 NEON으로는 float까지만 되도, double은 VFP를 통해서 가능할 것 같은데

D
Double precision floating-point values

F
Single precision floating-point values

H
Half precision floating-point values

I
Integer values

P
Polynomials with single-bit coefficients

X
Operation is independent of data representation.


Name Advanced SIMD VFP Description
VADD I, F F, D Add
VDIV - F, D Divide
VMUL I, F, P F, D Multiply
VSUB I, F F, D Subtract

[링크 : https://developer.arm.com/documentation/ddi0409/i/instruction-timing/cortex-a9-neon-mpe-instructions?lang=en]

타입을 바꾸어 봐도 안되서 골머리를 싸매다가(float는 된다매!!! double은 vfp로 된다매!!!)

main.c:187:2: missed: couldn't vectorize loop
main.c:177:6: missed: not vectorized: unsupported data-type double


main.c:187:2: missed: couldn't vectorize loop
main.c:177:6: missed: not vectorized: unsupported data-type float

 

금단의 플래그를 설정하니 잘 된다. -_-

main.c:194:2: optimized: loop vectorized using 16 byte vectors
main.c:188:2: optimized: loop vectorized using 16 byte vectors

 

IEEE를 무시하고 안전하지 않은 연산도 적용되고 하다보니 영 쓰기가 불안한데...

In addition GCC offers the -ffast-math flag which is a shortcut for several options, presenting the least conforming but fastest math mode. It enables -fno-trapping-math, -funsafe-math-optimizations, -ffinite-math-only, -fno-errno-math, -fno-signaling-nans, -fno-rounding-math, -fcx-limited-range and -fno-signed-zeros. Each of these flags violates IEEE in a different way. -ffast-math also may disable some features of the hardware IEEE implementation such as the support for denormals or flush-to-zero behavior. An example for such a case is x86_64 with it's use of SSE and SSE2 units for floating point math. 

[링크 : https://gcc.gnu.org/wiki/FloatingPointMath]


아무튼 어제 어디서 보다 찾았던 associative 옵션을 못찾아서 헤매다가 다시 생각나서 보는데

associative하지 않다.. 이게 무슨 의미지?

Goldberg 논문에 나온 것 처럼 floating-point의 계산은 associative하지 않다.
그러므로 ffast-math 연산 방식에서는 실제 값에 오류를 포함할 수 밖에 없다.
이러한 점 때문에 ffast-math 방식은 IEEE에서 정의한 방식을 따르지 못한다.

위와 같은 특징 때문에, 정확한 값을 계산해야하는 것이라면 ffast-math를 사용하면 안된다.
하지만 대충 어림잡아서 맞는 값을 원하는 것이라면?

[링크 : https://www.cv-learn.com/20210107-gcc-ffast-math/]


float 형의 오차로 인해서 계산때 마다 동일 결과가 나오지 않는다는 의미군..

결합의((a × b) × c = a × (b × c)의 예에서처럼 계산식이 부분의 순서와 상관없이 동일한 결과가 나오는)

[링크 : https://en.dict.naver.com/#/entry/enko/43a6bbaaacf546199c5d4c57b6b88ebb]


그래서 한번 -ffast-math 대신 적용해보려는데 다른 상위 옵션에 의해서 무시 당했다고 나온다.

누가 상위 옵션이려나?

-o -W -Wall -fopt-info-vec -march=armv7-a -mfpu=neon -O3 -fassociative-math

cc1: warning: ‘-fassociative-math’ disabled; other options take precedence


-ffast-math 보단 순한 맛이긴 한데 적용이 안되면 의미 없지 머..

-fassociative-math
Allow re-association of operands in series of floating-point operations. This violates the ISO C and C++ language standard by possibly changing computation result. NOTE: re-ordering may change the sign of zero as well as ignore NaNs and inhibit or create underflow or overflow (and thus cannot be used on code that relies on rounding behavior like (x + 2**52) - 2**52. May also reorder floating-point comparisons and thus may not be used when ordered comparisons are required. This option requires that both -fno-signed-zeros and -fno-trapping-math be in effect. Moreover, it doesn’t make much sense with -frounding-math. For Fortran the option is automatically enabled when both -fno-signed-zeros and -fno-trapping-math are in effect.

The default is -fno-associative-math.

[링크 : https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html]

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc __cplusplus 선언  (0) 2026.02.18
gcc __attribute__((weak)) 테스트  (0) 2026.01.29
gcc tree vectorize  (0) 2023.01.26
gcc fstack-protector-strong  (0) 2022.12.06
gcc vectorization 실패  (0) 2022.06.02
Posted by 구차니
프로그램 사용/gcc2023. 1. 26. 19:55

필수

-O3 -ftree-vectorize

(-O2 에서는 -ftree-vectorize가 적용되지 않는다.)

 

옵션(?)

-mfpu=neon -fopt-info-vec[-all]

 

neon을 지정안해주어도 cortex-a9 에서 vfp로 되는진 모르겠지만

약간 변환되는게 있고

neon을 지정해주면 많이 늘어난다

 

[링크 : https://developer.arm.../Compiling-NEON-Instructions/Vectorization/Enabling-auto-vectorization-in-GCC-compiler]

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc __attribute__((weak)) 테스트  (0) 2026.01.29
gcc cortex-a9 double형 neon 연산 가속  (3) 2023.08.08
gcc fstack-protector-strong  (0) 2022.12.06
gcc vectorization 실패  (0) 2022.06.02
gcc / 문자열 선언  (0) 2022.03.17
Posted by 구차니
프로그램 사용/gcc2022. 12. 6. 16:59

fno 되어있어서 웬지 눈에 익숙한 느낌인데 

-fno-stack-protector

 

새로운게 보여서 찾아보니

말 그대로 stack 오버런이 발생하는지 감지하는 기능을 제공한다고 한다.

[링크 : https://m.blog.naver.com/neos_rtos/220688072708]

[링크 : https://developer.arm.com/documentation/101754/0618/armclang-Reference/armclang-Command-line-Options/-fstack-protector---fstack-protector-all---fstack-protector-strong---fno-stack-protector]

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc cortex-a9 double형 neon 연산 가속  (3) 2023.08.08
gcc tree vectorize  (0) 2023.01.26
gcc vectorization 실패  (0) 2022.06.02
gcc / 문자열 선언  (0) 2022.03.17
static link  (0) 2022.02.07
Posted by 구차니
프로그램 사용/gcc2022. 6. 2. 14:47

아래 에러들은 SIMD 명령으로 변환하는데 실패한 녀석들인것 같은데

아래와 같은 유형들이 에러로 발생했다.

 

반복문이 중첩되거나, 반복문 내에서 조건문이 있으면 안되는 것 같고

tt.c:180:3: note: ===== analyze_loop_nest =====
tt.c:180:3: note: === vect_analyze_loop_form ===
tt.c:180:3: note: not vectorized: control flow in loop.
tt.c:180:3: note: bad loop form.


tt.c:61:3: note: ===== analyze_loop_nest =====
tt.c:61:3: note: === vect_analyze_loop_form ===
tt.c:61:3: note: not vectorized: multiple nested loops.
tt.c:61:3: note: bad loop form.

 

아래부터는 어떤 에러인지 감이 안오는 녀석들..

지원하지 않는 패턴

tt.c:83:7: note: Unsupported pattern.
tt.c:83:7: note: not vectorized: unsupported use in stmt.
tt.c:83:7: note: unexpected pattern.

 

지원되지 않는 데이터 타입. 코드를 보니 for문의 비교문에

함수 포인터를 통한 참조(->) 로 보려고 할때는 타입을 추적 못하는 듯?

tt.c:107:5: note: not vectorized: unsupported data-type
tt.c:107:5: note: can't determine vectorization factor.

 

no grouped store가 어떤건지 모르겠다.

val = data[];

out = data / 255;

이런식으로 단순화 가능한 코드인데 배열과 포인터로 배열 인자가 선형으로 분석될수 없기 때문에 그런걸지도?

tt.c:106:3: note: not vectorized: no grouped stores in basic block.
tt.c:106:3: note: ===vect_slp_analyze_bb===
tt.c:106:3: note: ===vect_slp_analyze_bb===
tt.c:108:32: note: === vect_analyze_data_refs ===
tt.c:108:32: note: not vectorized: not enough data-refs in basic block.

 

모르겠고..

tt.c:228:3: note: not vectorized: data ref analysis failed _47 = *_46;
tt.c:228:3: note: bad data references.

 

모르겠다!!!

tt.c:238:5: note: not vectorized: not suitable for gather load _47 = *_46;
tt.c:238:5: note: bad data references.

 

 

아무튼 AVX로도 변환이 안되는데 .. NEON으로 최적화 될만한 코드는 더더욱 아닐 것 같네.

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc tree vectorize  (0) 2023.01.26
gcc fstack-protector-strong  (0) 2022.12.06
gcc / 문자열 선언  (0) 2022.03.17
static link  (0) 2022.02.07
구조체 타입과 변수명은 구분된다?  (0) 2021.11.18
Posted by 구차니