[LLVMdev] Porting to System z
Neale Ferguson
neale at sinenomine.net
Tue Apr 7 13:00:53 PDT 2009
No it didn't work without optimization. Looking at all the C++ manuals etc.
the idea of forcing an enum to a different size is a practice fraught with
danger. It appears gcc 4.3.3 insists on sizeof(enum) == sizeof(int) so the
union trick is not going to work. Is there any reason it needs to be an
enum? Could SimpleValueType be a typedef long which means the union would
work for _LP64 and _LP32 systems?
Neale
On 4/7/09 3:57 PM, "Duncan Sands" <baldrick at free.fr> wrote:
> Hi Neale,
>
>> The comment in the above fix indicates that in this 64-bit system the enum
>> needs to be 64-bits is correct, but the fix doesn't seem to do it.
>
> the basic problem seems to be that your system compiler is miscompiling
> LLVM. Mucking around with the details of the union in the hope of tricking
> the compiler into not miscompiling is one approach, but as you saw each
> broken compiler tends to be broken differently :) I'm quite surprised
> though because you said you are using gcc 4.3 (right?). This may be a
> sign that something is wrong in LLVM rather than in the system compiler...
> Did it work when building without optimization?
>
> Ciao,
>
> Duncan.
>
More information about the llvm-dev
mailing list