모바일 오유 바로가기
http://m.todayhumor.co.kr
분류 게시판
베스트
  • 베스트오브베스트
  • 베스트
  • 오늘의베스트
  • 유머
  • 유머자료
  • 유머글
  • 이야기
  • 자유
  • 고민
  • 연애
  • 결혼생활
  • 좋은글
  • 자랑
  • 공포
  • 멘붕
  • 사이다
  • 군대
  • 밀리터리
  • 미스터리
  • 술한잔
  • 오늘있잖아요
  • 투표인증
  • 새해
  • 이슈
  • 시사
  • 시사아카이브
  • 사회면
  • 사건사고
  • 생활
  • 패션
  • 패션착샷
  • 아동패션착샷
  • 뷰티
  • 인테리어
  • DIY
  • 요리
  • 커피&차
  • 육아
  • 법률
  • 동물
  • 지식
  • 취업정보
  • 식물
  • 다이어트
  • 의료
  • 영어
  • 맛집
  • 추천사이트
  • 해외직구
  • 취미
  • 사진
  • 사진강좌
  • 카메라
  • 만화
  • 애니메이션
  • 포니
  • 자전거
  • 자동차
  • 여행
  • 바이크
  • 민물낚시
  • 바다낚시
  • 장난감
  • 그림판
  • 학술
  • 경제
  • 역사
  • 예술
  • 과학
  • 철학
  • 심리학
  • 방송연예
  • 연예
  • 음악
  • 음악찾기
  • 악기
  • 음향기기
  • 영화
  • 다큐멘터리
  • 국내드라마
  • 해외드라마
  • 예능
  • 팟케스트
  • 방송프로그램
  • 무한도전
  • 더지니어스
  • 개그콘서트
  • 런닝맨
  • 나가수
  • 디지털
  • 컴퓨터
  • 프로그래머
  • IT
  • 안티바이러스
  • 애플
  • 안드로이드
  • 스마트폰
  • 윈도우폰
  • 심비안
  • 스포츠
  • 스포츠
  • 축구
  • 야구
  • 농구
  • 바둑
  • 야구팀
  • 삼성
  • 두산
  • NC
  • 넥센
  • 한화
  • SK
  • 기아
  • 롯데
  • LG
  • KT
  • 메이저리그
  • 일본프로야구리그
  • 게임1
  • 플래시게임
  • 게임토론방
  • 엑스박스
  • 플레이스테이션
  • 닌텐도
  • 모바일게임
  • 게임2
  • 던전앤파이터
  • 마비노기
  • 마비노기영웅전
  • 하스스톤
  • 히어로즈오브더스톰
  • gta5
  • 디아블로
  • 디아블로2
  • 피파온라인2
  • 피파온라인3
  • 워크래프트
  • 월드오브워크래프트
  • 밀리언아서
  • 월드오브탱크
  • 블레이드앤소울
  • 검은사막
  • 스타크래프트
  • 스타크래프트2
  • 베틀필드3
  • 마인크래프트
  • 데이즈
  • 문명
  • 서든어택
  • 테라
  • 아이온
  • 심시티5
  • 프리스타일풋볼
  • 스페셜포스
  • 사이퍼즈
  • 도타2
  • 메이플스토리1
  • 메이플스토리2
  • 오버워치
  • 오버워치그룹모집
  • 포켓몬고
  • 파이널판타지14
  • 배틀그라운드
  • 기타
  • 종교
  • 단어장
  • 자료창고
  • 운영
  • 공지사항
  • 오유운영
  • 게시판신청
  • 보류
  • 임시게시판
  • 메르스
  • 세월호
  • 원전사고
  • 2016리오올림픽
  • 2018평창올림픽
  • 코로나19
  • 2020도쿄올림픽
  • 게시판찾기
  • 오유인페이지
    개인차단 상태
    ★☆님의
    개인페이지입니다
    가입 : 17-07-17
    방문 : 493회
    닉네임변경 이력
    회원차단
    회원차단해제
    게시물ID : programmer_22755
    작성자 : ★☆
    추천 : 0
    조회수 : 1035
    IP : 222.233.***.246
    댓글 : 0개
    등록시간 : 2018/12/26 22:51:51
    http://todayhumor.com/?programmer_22755 모바일
    [gcc] 적용되는 옵션 플래그 확인하기
    두근두근 울렁울렁 가슴 뛰지만 무섭고도 두려워서 겁이 나지만 생각난 김에 이것도 써두는 것이 좋겠네요 :)

    Gcc 를 사용하다 보면 가끔 미리 정의된 매크로가 무엇인지 알고 싶은 때가 있습니다. 이럴 때,
    gcc -dM -E - < /dev/null
    라는 명령을 내려서 확인하는 것은 널리 알려진 사용법입니다. 만일, 미리 정의된 옵션이 어떤 것인지 알고 싶을때는 어떻게 할까요? 예를 들어, -O0 옵션과 -O2 옵션의 차이는 무엇일까요? 이렇게 명령을 내립니다. (예에서는 -O2 옵션을 봅니다.)
    echo 'int main(){return 0;}' | gcc -v -Q -O2 -x c -
    C++ 에 적용되는 옵션을 알고싶다면 -x c 대신 -x c++ 이라고 합니다. 화면에 여러 줄이 지나갈텐데요... 제 환경에서는 다음과 같은 차이가 있습니다.

    -O0 -O2
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    options passed: -v - -march=core2 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-sgx -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=core2 -O0 -v - -march=core2 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -mno-aes -mno-sha -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-sgx -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=core2 -O2
    options enabled: -fPIC -fPIE -faggressive-loop-optimizations -fasynchronous-unwind-tables -fauto-inc-dec -fchkp-check-incomplete-type -fchkp-check-read -fchkp-check-write -fchkp-instrument-calls -fchkp-narrow-bounds -fchkp-optimize -fchkp-store-bounds -fchkp-use-static-bounds -fchkp-use-static-const-bounds -fchkp-use-wrappers -fcommon -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types -ffp-int-builtin-inexact -ffunction-cse -fgcse-lm -fgnu-runtime -fgnu-unique -fident -finline-atomics -fira-hoist-pressure -fira-share-save-slots -fira-share-spill-slots -fivopts -fkeep-static-consts -fleading-underscore -flifetime-dse -flto-odr-type-merging -fmath-errno -fmerge-debug-strings -fpeephole -fplt -fprefetch-loop-arrays -freg-struct-return -fsched-critical-path-heuristic -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-fusion -fsemantic-interposition -fshow-column -fshrink-wrap-separate -fsigned-zeros -fsplit-ivs-in-unroller -fssa-backprop -fstack-protector-strong -fstdarg-opt -fstrict-volatile-bitfields -fsync-libcalls -ftrapping-math -ftree-cselim -ftree-forwprop -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-reassoc -ftree-scev-cprop -funit-at-a-time -funwind-tables -fvar-tracking -fvar-tracking-assignments -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387 -malign-stringops -mcx16 -mfancy-math-387 -mfp-ret-in-387 -mfxsr -mglibc -mieee-fp -mlong-double-80 -mmmx -mpush-args -mred-zone -msahf -msse -msse2 -msse3 -msse4.1 -mssse3 -mstv -mtls-direct-seg-refs -mvzeroupper -fPIC -fPIE -faggressive-loop-optimizations -falign-labels -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcaller-saves -fchkp-check-incomplete-type -fchkp-check-read -fchkp-check-write -fchkp-instrument-calls -fchkp-narrow-bounds -fchkp-optimize -fchkp-store-bounds -fchkp-use-static-bounds -fchkp-use-static-const-bounds -fchkp-use-wrappers -fcode-hoisting -fcombine-stack-adjustments -fcommon -fcompare-elim -fcprop-registers -fcrossjumping -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types -fexpensive-optimizations -fforward-propagate -ffp-int-builtin-inexact -ffunction-cse -fgcse -fgcse-lm -fgnu-runtime -fgnu-unique -fguess-branch-probability -fhoist-adjacent-loads -fident -fif-conversion -fif-conversion2 -findirect-inlining -finline -finline-atomics -finline-functions-called-once -finline-small-functions -fipa-bit-cp -fipa-cp -fipa-icf -fipa-icf-functions -fipa-icf-variables -fipa-profile -fipa-pure-const -fipa-ra -fipa-reference -fipa-sra -fipa-vrp -fira-hoist-pressure -fira-share-save-slots -fira-share-spill-slots -fisolate-erroneous-paths-dereference -fivopts -fkeep-static-consts -fleading-underscore -flifetime-dse -flra-remat -flto-odr-type-merging -fmath-errno -fmerge-constants -fmerge-debug-strings -fmove-loop-invariants -fomit-frame-pointer -foptimize-sibling-calls -foptimize-strlen -fpartial-inlining -fpeephole -fpeephole2 -fplt -fprefetch-loop-arrays -free -freg-struct-return -freorder-blocks -freorder-functions -frerun-cse-after-loop -fsched-critical-path-heuristic -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-fusion -fschedule-insns2 -fsemantic-interposition -fshow-column -fshrink-wrap -fshrink-wrap-separate -fsigned-zeros -fsplit-ivs-in-unroller -fsplit-wide-types -fssa-backprop -fssa-phiopt -fstack-protector-strong -fstdarg-opt -fstore-merging -fstrict-aliasing -fstrict-volatile-bitfields -fsync-libcalls -fthread-jumps -ftoplevel-reorder -ftrapping-math -ftree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-coalesce-vars -ftree-copy-prop -ftree-cselim -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-pre -ftree-pta -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-slsr -ftree-sra -ftree-switch-conversion -ftree-tail-merge -ftree-ter -ftree-vrp -funit-at-a-time -funwind-tables -fvar-tracking -fvar-tracking-assignments -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387 -malign-stringops -mcx16 -mfancy-math-387 -mfp-ret-in-387 -mfxsr -mglibc -mieee-fp -mlong-double-80 -mmmx -mpush-args -mred-zone -msahf -msse -msse2 -msse3 -msse4.1 -mssse3 -mstv -mtls-direct-seg-refs -mvzeroupper



    덧붙임: 위에서 최적화 레벨에 따라 차이가 나는 것은 options enabled 부분입니다. Options passed 부분은 큰 차이가 나지 않는데요... CPU 에 따라 왜 이런 옵션들이 선택되었는지 보려면 다음과 같은 명령을 내립니다.
    gcc -c -Q -march=native --help=target

    이 게시물을 추천한 분들의 목록입니다.
    푸르딩딩:추천수 3이상 댓글은 배경색이 바뀝니다.
    (단,비공감수가 추천수의 1/3 초과시 해당없음)

    죄송합니다. 댓글 작성은 회원만 가능합니다.

    번호 제 목 이름 날짜 조회 추천
    897
    윈도우 원격 데스크톱과 Xrdp 서버 사이에 클립보드 공유 실패 ★☆ 19/01/19 03:39 116 0
    896
    [emacs] 글꼴 설정 [2] ★☆ 19/01/18 08:52 83 1
    895
    [emacs] EXWM 간단히 맛보기(?), 냄새 맡기(?), 암튼 소개 ★☆ 19/01/08 05:59 116 1
    894
    나의 기본 Makefile [2] ★☆ 18/12/29 06:24 120 4
    [gcc] 적용되는 옵션 플래그 확인하기 ★☆ 18/12/26 22:51 73 0
    892
    [gcc] 어셈블리 코드 보기 [11] ★☆ 18/12/26 18:08 104 0
    891
    const 한정자는 좋은 코딩 습관의 기초 [1] ★☆ 18/12/22 00:30 78 2
    890
    [gcc] 의미없어 보이지만 의미심장한 (X)+0 그리고 함수 오버로딩 [6] ★☆ 18/12/21 07:40 108 2
    889
    재미있는 상황?? [1] ★☆ 18/10/12 18:23 63 0
    888
    아빠가 너무 나대요... [5] 펌글 ★☆ 18/10/12 15:29 2104 12
    887
    저금통 샀다고 와잎한테 쳐맞은 남편... [4] 펌글 ★☆ 18/10/11 18:44 2099 19
    886
    관악산에 노루가 뛰논다를 영어로?(feat. 서울대 법대 합격하는 법) [5] 펌글 ★☆ 18/10/10 23:58 1662 12
    885
    ㅈ간지 연출 [6] 펌글 ★☆ 18/10/10 23:53 2018 10
    884
    뒤틀린 학구열 [2] 펌글 ★☆ 18/10/10 23:50 1667 14
    883
    웃대가 오유 먹었다 야호 [4] 펌글 ★☆ 18/10/10 23:38 1127 17
    882
    귀여운 약사를 만난 루리웹 유저 [6] 펌글 ★☆ 18/10/10 23:26 1497 18
    881
    미대생의 농락 ㅋㅋㅋㅋㅋㅋㅋㅋㅋ [2] 펌글 ★☆ 18/10/10 23:11 1622 15
    880
    군필자가 세금으로 배워온 기술 [6] 펌글 ★☆ 18/10/10 23:01 1618 16
    879
    마법사 세계에서 포켓몬이 금지인 이유 [1] 펌글 ★☆ 18/10/10 22:51 1197 5
    878
    조별과제 침대 빌런 [7] 펌글 ★☆ 18/10/10 22:39 1420 15
    877
    이거 방울토마토 맞음? 펌글 ★☆ 18/10/10 22:30 883 5
    876
    입뺀 당한 김희철 [2] 펌글 ★☆ 18/10/10 22:23 1133 10
    875
    32살이나 먹고 똥을 지린 남자 [12] 펌글 ★☆ 18/10/10 22:15 1554 11
    874
    무술의 천재 [2] 펌글 ★☆ 18/10/10 22:11 1190 11
    873
    환장의 호흡 feat.웃대 [10] 펌글 ★☆ 18/10/10 22:04 872 10
    872
    북한 야동사이트 접속기록 통계 [10] 펌글 ★☆ 18/10/10 21:53 1741 10
    871
    북서유럽과 동남유럽의 차이 [2] 펌글 ★☆ 18/10/10 21:42 1287 7
    870
    경계가 너무 심한 중고나라 [3] 펌글 ★☆ 18/10/10 21:38 1446 19
    869
    소개팅 직업 레전드 [2] 펌글 ★☆ 18/10/10 21:34 1411 10
    868
    흔한 뇌가 히토미류 甲 [14] 펌글 ★☆ 18/10/10 21:23 1415 14
    [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [다음10개▶]
    단축키 운영진에게 바란다(삭제요청/제안) 운영게 게시판신청 자료창고 보류 개인정보취급방침 청소년보호정책 모바일홈