]> git.lizzy.rs Git - rust.git/commitdiff
[MSP430] Don't enable trap_unreachable option by default on msp.
authorVadzim Dambrouski <pftbest@gmail.com>
Tue, 30 Jan 2018 21:57:30 +0000 (00:57 +0300)
committerVadzim Dambrouski <pftbest@gmail.com>
Tue, 30 Jan 2018 21:57:30 +0000 (00:57 +0300)
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.

src/librustc_back/target/msp430_none_elf.rs

index 509a7cf5e03234158d70a61ca70ec53cbb749b74..966df897f01f1e09295b609d7c3530fbb5e4378a 100644 (file)
@@ -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( )
         }
     })