Skip to content

crash on cast of fwrite address #1282

@nlewycky

Description

@nlewycky
Bugzilla Link 910
Resolution FIXED
Resolved on Feb 22, 2010 12:43
Version 1.7
OS All

Extended Description

This code came out of the CBE when I was running bugpoint. Amazingly, it crashes
llvm-gcc:

$ llvm-gcc -O0 -emit-llvm 000.c -c -o 000.bc
000.c: In function ‘Usage’:
000.c:7: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://llvm.org/bugs for instructions.

Here's the code reduced snippet:

struct l_struct_2E_FILE { char x; };
unsigned fwrite(signed char *, unsigned , unsigned , signed char *);
static signed char str301[39];
static void Usage(signed char *ltmp_611_6) {
struct l_struct_2E_FILE ltmp_6202_16;
unsigned ltmp_6203_92;
ltmp_6203_92 = /tail/ ((unsigned (
) (signed char *, unsigned , unsigned ,
struct l_struct_2E_FILE ))(void)fwrite)((&(str301[0u])), 38u, 1u, ltmp_6202_16);
}

It crashes even if you remove the first line defining struct l_struct_2E_FILE,
but then it ceases to be a crash on valid.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillacompile-failUse [accepts-invalid] and [rejects-valid] insteadllvm-toolsAll llvm tools that do not have corresponding tag

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions