Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
B
benchmark
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • benchmark
  • Repository

Switch branch/tag
  • benchmark
  • test
  • donotoptimize_test.cc
Find file
BlameHistoryPermalink
  • Eric's avatar
    Fix #342: DoNotOptimize causes compile errors on older GCC versions. (#398) · 93bfabc8
    Eric authored Jun 02, 2017
    * Fix #342: DoNotOptimize causes compile errors on older GCC versions.
    
    DoNotOptimize uses inline assembly contraints to tell
    the compiler what the type of the input variable. The 'g'
    operand allows the input to be any register, memory, or
    immediate integer operand. However this constraint seems
    to be too weak on older GCC versions, and certain inputs
    will cause compile errors.
    
    This patch changes the constraint to 'X', which is documented
    as "any operand whatsoever is allowed". This appears to fix
    the issues with older GCC versions.
    
    However Clang doesn't seem to like "X", and will attempt
    to put the input into a register even when it can't/shouldn't;
    causing a compile error. However using "g" seems to work like
    "X" with GCC, so for this reason Clang still uses "g".
    
    * Try alternative formulation to placate GCC
    93bfabc8
donotoptimize_test.cc 1.19 KB
EditWeb IDE
×

Replace donotoptimize_test.cc

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.