diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-12-15 12:16:16 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-12-15 12:16:16 +0100 |
commit | dd34b354f8c29f318204d74780f8ebc00be443df (patch) | |
tree | 44f561c35aed459755ed63d22b61f3e060c16be8 /arm | |
parent | ab6c84c6caa819328018e9e8629c9ecc6802dcd3 (diff) | |
download | compcert-dd34b354f8c29f318204d74780f8ebc00be443df.tar.gz compcert-dd34b354f8c29f318204d74780f8ebc00be443df.zip |
Fallthrough no depends on the last instruction.
Since the test for emit constants has moved before the printing of
the instruction the no_fallthrough of the last test should be used.
Bug 20598
Diffstat (limited to 'arm')
-rw-r--r-- | arm/TargetPrinter.ml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arm/TargetPrinter.ml b/arm/TargetPrinter.ml index 149f5027..cb379f26 100644 --- a/arm/TargetPrinter.ml +++ b/arm/TargetPrinter.ml @@ -766,12 +766,12 @@ struct | _ -> 12 - let rec print_instructions oc instrs = + let rec print_instructions oc no_fall instrs = match instrs with | [] -> () | i :: il -> let d = distance_to_emit_constants() - estimate_size i in - if d < 256 && no_fallthrough i then + if d < 256 && no_fall then emit_constants oc else if d < 16 then begin let lbl = new_label() in @@ -781,7 +781,7 @@ struct end; let n = print_instruction oc i in currpos := !currpos + n * 4; - print_instructions oc il + print_instructions oc (no_fallthrough i) il let get_section_names name = let (text, lit) = @@ -822,7 +822,7 @@ struct let print_instructions oc fn = current_function_sig := fn.fn_sig; ignore (fixup_arguments oc Incoming fn.fn_sig); - print_instructions oc fn.fn_code; + print_instructions oc false fn.fn_code; if !literals_in_code then emit_constants oc let emit_constants oc lit = |