[llvm-commits] [llvm-gcc-4.2] r69795 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Thu Apr 23 01:03:37 PDT 2009


Hi Chris,

> Thanks for doing this.  Do you have a testcase?

I only have an Ada testcase, and since you can't even build
the Ada front-end without this fix it seemed rather pointless
to add it to the testsuite.

> Is this right on big-endian systems?

I think so but I'm not sure.

By the way, isn't this just the same as how C stores an
integer to a bitfield?  Suppose you have
  int x : 2;
Then when you write a value to x, what happens?  The
value is truncated down to 2 bits and those bits are
stored.  In the record constructor, each field of the
constructor is being assigned to the corresponding
bitfield.  So it seems reasonable to me to say that
integers get truncated down to the size of the bitfield
before being stored.  It's not that I like it, but it is
consistent with C bitfield assignment.

Ciao,

Duncan.



More information about the llvm-commits mailing list