diff options
author | Michael Schmidt <github@mschmidt.me> | 2017-05-03 17:36:53 +0200 |
---|---|---|
committer | Michael Schmidt <github@mschmidt.me> | 2017-05-03 17:36:53 +0200 |
commit | 996d8079ef32cbf6c83c458a5df4e548def2d2dc (patch) | |
tree | f83c126d7d4c5803a82b61cf04bdc7003af55687 | |
parent | 2bbb20db14cba7c2a460f58ae84c2526e3bb35aa (diff) | |
download | compcert-996d8079ef32cbf6c83c458a5df4e548def2d2dc.tar.gz compcert-996d8079ef32cbf6c83c458a5df4e548def2d2dc.zip |
bug 20956, print correct error message depending on architecture
-rw-r--r-- | powerpc/Asmexpand.ml | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml index da229d0b..fc787a35 100644 --- a/powerpc/Asmexpand.ml +++ b/powerpc/Asmexpand.ml @@ -554,14 +554,20 @@ let expand_builtin_inline name args res = else raise (Error "__builtin_get_spr64 is only supported for PPC64 targets") | "__builtin_get_spr64", _, _ -> - raise (Error "the argument of __builtin_get_spr64 must be a constant") + if Archi.ppc64 then + raise (Error "the argument of __builtin_get_spr64 must be a constant") + else + raise (Error "__builtin_get_spr64 is only supported for PPC64 targets") | "__builtin_set_spr64", [BA_int n; BA(IR a)], _ -> if Archi.ppc64 then emit (Pmtspr(n, a)) else raise (Error "__builtin_set_spr64 is only supported for PPC64 targets") | "__builtin_set_spr64", _, _ -> - raise (Error "the first argument of __builtin_set_spr64 must be a constant") + if Archi.ppc64 then + raise (Error "the first argument of __builtin_set_spr64 must be a constant") + else + raise (Error "__builtin_set_spr64 is only supported for PPC64 targets") (* Move registers *) | "__builtin_mr", [BA_int dst; BA_int src], _ -> (match int_to_int_reg (Z.to_int dst), int_to_int_reg (Z.to_int src) with |