diff options
author | Pierre Langlois <pierre.langlois@arm.com> | 2016-09-22 11:15:35 +0100 |
---|---|---|
committer | Pierre Langlois <pierre.langlois@arm.com> | 2016-09-29 15:10:09 +0100 |
commit | f5348cedd702124c90fc75e75d0195e2e485c620 (patch) | |
tree | 45deaac9c771ff62698523708ba0c544ecb20544 /SConstruct | |
parent | 5b0cbc8d721ff369c76e09ff1e7ab878ffcae4e9 (diff) | |
download | vixl-f5348cedd702124c90fc75e75d0195e2e485c620.tar.gz |
Remove implicit 64 to 32 bit narrowing
This patch fixes cases of implicit 64 to 32 bit narrowing. The issue is
that `CodeBuffer` represents code offsets with `ptrdiff_t`, which will
be 64 bit on a 64 bit system. However, we want to support generating 32
bit code from a 64 bit program, therefore the 32 bit part of VIXL works
with `int32_t` for code offsets. We had implicit conversions happening
due to this.
We solve this by explicitely casting to `int32_t` in the AArch32
assembler when calling `GetCursorOffset`. If you are working with the
`CodeBuffer` directly, you are dealing with a code buffer on the host
and so will work with offsets as `ptrdiff_t`. But, when working with the
AArch32 assembler itself you will get offsets as `int32_t`. The
assembler is in charge of checking that the offsets it gets from the
code buffer fit into `int32_t`.
Additionally, we had narrowing cases when generally wrapping host
pointers into an Operand. This can only work if the pointer fits into 32
bits. This patch introduces a Operand::From() factory method that can be
used for converting any integral or pointer type to an immediate
operand.
Change-Id: Icc15711b34c2477ed997eef238e25496d86ea9aa
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -260,8 +260,6 @@ def ConfigureEnvironmentForCompiler(env): if not using_clang3_4: env.Append(CPPFLAGS = ['-Wunreachable-code']) - env.Append(CPPFLAGS = ['-Wno-shorten-64-to-32']) - # GCC 4.8 has a bug which produces a warning saying that an anonymous Operand # object might be used uninitialized: # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57045 |