모바일 오유 바로가기
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도쿄올림픽
  • 게시판찾기
  • 게시물ID : programmer_22755
    작성자 : ★☆
    추천 : 0
    조회수 : 1031
    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 초과시 해당없음)

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

    번호 제 목 이름 날짜 조회 추천
    23105
    일반인 입니다 무작위의 숫자와영어로 적혀 있는 파일입니다. [2] 창작글 너를위한마음 20/04/21 15:13 1086 0
    23104
    c++ 코딩 간단한 질문 하나만 올립니다. [2] 중국인의피 20/04/21 14:54 999 0
    23103
    C#으로 오토캐드용 보조프로그램 만들고 싶어요 [5] 본인삭제금지 별빛러브 20/04/20 22:08 1488 0
    23102
    네트워크 통신에 관해서.. [5] 본인삭제금지 DJ.A 20/04/17 01:17 905 0
    23100
    파이썬 pywinauto로 자동화 구현해보신 분 계신가요? [8] 본인삭제금지 훗날닭집사장 20/04/15 23:39 2682 0
    23098
    API 질문있습니다! 생공장 20/04/14 21:55 604 0
    23097
    파이썬 Qt Designer로 UI를 구현중인데 질문이 있습니다! [4] 본인삭제금지 훗날닭집사장 20/04/12 16:14 928 0
    23095
    [본삭금] linux svn commit 에러 문제입니다. 베스트금지베오베금지본인삭제금지외부펌금지 오늘이라도 20/04/08 20:37 666 0
    23093
    mfc typedef carray 만들면 자기 클래스에 선언 못하나요?? [2] 소막 20/04/04 12:51 721 0
    23092
    [1인개발][안드로이드][cocos2dx] 틀린그림찾기 게임을 만들었습니 [2] 창작글 하오링찡 20/04/04 11:24 774 2
    23091
    파이썬) pymysql 사용 처음부터 문제가 생겼습니다! ㅠㅠ [8] 본인삭제금지 훗날닭집사장 20/04/01 17:13 7640 0
    23089
    c++ 조언 부탁드려요. [1] 본인삭제금지 우홋 20/03/30 15:49 683 0
    23088
    Java IDE 선호도가 궁금하네요. [9] 목욕통 20/03/30 12:44 1047 0
    23087
    죄송하지만. 혹여 잠시 시간 내어 주실 분들에게 질문 구해요. [3] 본인삭제금지 초급인 20/03/29 15:22 800 0
    23086
    비베 고수님들 질문있습니다2 인천개장수 20/03/28 01:07 523 0
    23085
    장글 질문입니다. C++ 프로그램에 대해서 질문 있습니다. [3] 본인삭제금지 초급인 20/03/26 06:25 658 0
    23083
    파이썬으로 크롤링 + 로그인 관련해서 질문이 있습니다.. [14] 본인삭제금지 훗날닭집사장 20/03/24 15:58 1318 0
    23082
    참 궁금한 것이 있는데요 [8] 큰녀가좋아 20/03/24 14:41 746 2
    23081
    자바 이클립스 간단한 질문하나 올립니다 [15] 외부펌금지 중국인의피 20/03/22 19:53 809 1
    23080
    캡스톤 디자인 과제로 모바일 pos를 만들어볼까 합니다. [3] 본인삭제금지 창기름 20/03/18 17:38 707 0
    23079
    c# 불용어처리기 제작중 질문이 생겼습니다. [14] 창작글본인삭제금지 창기름 20/03/17 23:19 809 0
    23078
    mfc 정보는 최신글 찾기가 왜이렇게 어려운가요 ㅠㅠ [2] 소막 20/03/17 21:17 714 0
    23077
    혹시 여기서 책 추천도 해주시려나요?.. [2] user6000 20/03/14 18:11 644 0
    23075
    안드로이드에서 다른패케이지의 파일접근권한에대한 질문입니다 본인삭제금지 엿먹이기 20/03/11 13:41 537 0
    23074
    공적 마스크 실시간 알림에 관하여 [1] 튜머 20/03/10 15:39 807 1
    23071
    (업무관련)g매크로와 비슷한 기능을 가진 프로그램이 있나요? [7] 문식이당 20/03/06 14:22 1747 0
    23070
    게임 관련 공모전에 관심 있는 분 있으신 분!!! 송초코 20/03/05 19:00 673 0
    23069
    안드로이드 에서 nfc 를이용해서 출결체크하는 앱을 만들고싶습니다 [3] 본인삭제금지 뭐꼬 20/03/03 14:19 763 0
    23068
    c# 사운드 녹음에대해 질문. [1] 외부펌금지 눙무이 20/03/03 11:47 987 0
    23067
    c# 에서 sqlite 작업시 System.Data.SQLite.dll [1] 본인삭제금지 엿먹이기 20/02/29 13:22 841 0
    [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [다음10개▶]
    단축키 운영진에게 바란다(삭제요청/제안) 운영게 게시판신청 자료창고 보류 개인정보취급방침 청소년보호정책 모바일홈