[llvm-dev] Some strange i64 behavior with arm 32bit. (Raspberry Pi)
Moritz Angermann via llvm-dev
llvm-dev at lists.llvm.org
Fri Dec 1 02:30:08 PST 2017
Hi Tim,
thanks for the swift response!
@debug is defined in the same module, which makes this all the more confusing.
The target information from the working example are:
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv6kz--linux-gnueabihf"
from the ghc produced module:
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "arm-unknown-linux-gnueabihf"
However there ones more thing, I could think of, arm does allow mixed mode
I believe. And as such as the code from the ghc produced module is called
from outside of the module, could the endianness be set there prior to
entering the function?
The working module contains the main directly and is not called from a main
function in a different module.
I've also tried to define a regular c function with the same code and called
that from within the ghccc function with the same (incorrect) results.
Any further ideas I could expore?
Cheers,
Moritz
> On Dec 1, 2017, at 4:26 PM, Tim Northover <t.p.northover at gmail.com> wrote:
>
> Hi Moritz,
>> If someone could offer some hint, where to look further for debugging this, I'd very much appreciate the advice!
>> I'm a bit lost right now how to figure out why I end up getting swapped words.
>
> If one file was compiled for big-endian ARM and the other for
> little-endian that could be the result. I'm not aware of any other
> possible cause and from local tests I don't think the "ghccc" alone
> explains the difference.
>
> So maybe some glitch in how GHC was configured on your system? What's
> the triple at the top of the GHC module and the module containing the
> definition of @debug?
>
> Cheers.
>
> Tim.
More information about the llvm-dev
mailing list