Skip to content

Commit

Permalink
[MSP430] Don't enable trap_unreachable option by default on msp.
Browse files Browse the repository at this point in the history
Since MSP430 doesn't meaningfully support faulting on illegal
instructions, LLVM generates a call to abort() function instead
of a trap instruction. Such calls are 4 bytes long, and that is
too much overhead for such small target.
  • Loading branch information
pftbest committed Jan 30, 2018
1 parent def3269 commit 1e380cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustc_back/target/msp430_none_elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ pub fn target() -> TargetResult {
// don't want to invoke that many gcc instances.
default_codegen_units: Some(1),

// Since MSP430 doesn't meaningfully support faulting on illegal
// instructions, LLVM generates a call to abort() function instead
// of a trap instruction. Such calls are 4 bytes long, and that is
// too much overhead for such small target.
trap_unreachable: false,

.. Default::default( )
}
})
Expand Down

0 comments on commit 1e380cb

Please sign in to comment.