Open Bug 1112029 Opened 10 years ago Updated 2 years ago

In debug builds, MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE should only assert, not __builtin_unreachable

Categories

(Core :: MFBT, defect)

defect

Tracking

()

People

(Reporter: jruderman, Unassigned)

Details

Quoting Chris Peterson from bug 990764 comment 46: --- In debug builds today, MOZ_MAKE_COMPILER_BELIEVE_IS_UNREACHABLE calls both MOZ_ASSERT_UNREACHABLE and __builtin_unreachable/whatever. However, there is a risk that the compiler might optimize away the MOZ_ASSERT_UNREACHABLE even in debug builds, seeing that the code path leads to __builtin_unreachable. For more predictable debug tests, we could change MOZ_MAKE_COMPILER_BELIEVE_IS_UNREACHABLE to not call __builtin_unreachable in debug builds: #ifdef DEBUG # define MOZ_MAKE_COMPILER_BELIEVE_IS_UNREACHABLE(reason) MOZ_CRASH(reason) #else # define MOZ_MAKE_COMPILER_BELIEVE_IS_UNREACHABLE(reason) __builtin_unreachable() #endif
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.