Skip to content

miscompilation of union { long double } #3819

@llvmbot

Description

@llvmbot
Bugzilla Link 3447
Resolution FIXED
Resolved on Feb 01, 2009 02:13
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic

Extended Description

clang miscompiles the following:

ddunbar@lordcrumb:return-types$ cat fail.c
#include <stdio.h>
typedef union T0 { long double field0; } T0;
static T0 T0_values[] = {
{ (long double) 32 },
{ (long double) 32 },
};
int main(int argc, char **argv) {
printf(" fn424_RV: RV.field0 = %d\n", T0_values[1].field0 == (long double) 32);
return 0;
}
ddunbar@lordcrumb:return-types$ for x in gcc xcc; do echo "-- $x --"; $x -std=c99 -m64 fail.c && ./a.out; done
-- gcc --
fn424_RV: RV.field0 = 1
-- xcc --
fn424_RV: RV.field0 = 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:codegenIR generation bugs: mangling, exceptions, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions