Skip to content

memcpyopt miscompilation #8638

Closed
Closed
@regehr

Description

@regehr
Bugzilla Link 8266
Resolution FIXED
Resolved on Oct 01, 2010 12:44
Version trunk
OS Linux
CC @echristo

Extended Description

I reported a bug like this just the other day but then it went into hiding or was fixed. Hopefully you folks can nail it this time.

[regehr@gamow ~]$ clang -v
clang version 2.9 (trunk 115236)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr@gamow ~]$ clang -O1 small.c -o small
[regehr@gamow ~]$ ./small
Segmentation fault
[regehr@gamow ~]$ cat small.c
struct S0 {
int f0;
int f1;
int f2;
int f3;
int f4;
};

struct S0 g_20 = {0,0,0,0,0};

int func_4(int p_6, struct S0 p_7)
{
return p_6;
}

int main (void)
{
struct S0 l_10[1] = {{1,1,1,1,1}};
if(func_4(1, l_10[0]))
{
}
else
{
for (g_20.f1 = 0; g_20.f1 < 1; g_20.f1 = g_20.f1+1)
{
struct S0 tmp = {2,2,2,2,2};
l_10[g_20.f2] = tmp;
}
}
return 0;
}

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzilla

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions