major clang++ regression? - at least on mingw64

Hello Everyone

I am finding that I can compile but can’t run even the smallest of programs built using clang svn on mingw64 using windows 7 64. The problem has been there for over a week. No functions work, nothing that puts anything onto the stack, which is everything, will work.

Attached is the llvm .s file for this program below that doesn’t work for me.
Can somebody take a look and find out what’s wrong. If anybody could fix this it would be great as it’s holding me up.

If you compile with with asserts enabled the assert should fire if your machine is exhibiting the problem.

On Windows you can use echo %ERRORLEVEL% to see the result too at the command prompt.

By the way since I’m posting here, the cmake file for llvm seems to be broken. But I’ll post more on that mailing list.

Thanks

#include
inline int f( int x )
{
assert( x == 42 );
return x == 42 ? 0 : -1;
}
int main()
{
const int x = 42;
return f(x);
}

bug.s (1.08 KB)

I am finding that I can compile but can't run even the smallest of programs
built using clang svn on mingw64 using windows 7 64. The problem has been
there for over a week. No functions work, nothing that puts anything onto
the stack, which is everything, will work.

Indeed. The caller correctly puts the argument into %ecx, however, the
callee expects to see it in %rdi (which is x86-64 calling convention).
Can you try to indicate the working commit?

Thanks!

built using clang svn on mingw64 using windows 7 64. The problem has been
there for over a week. No functions work, nothing that puts anything onto
the stack, which is everything, will work.

Indeed. The caller correctly puts the argument into %ecx, however, the
callee expects to see it in %rdi (which is x86-64 calling convention).
Can you try to indicate the working commit?

Also, if you compile with -O2 - does the snippet work?

the stack, which is everything, will work.

Indeed. The caller correctly puts the argument into %ecx, however, the
callee expects to see it in %rdi (which is x86-64 calling convention).
Can you try to indicate the working commit?

Also, if you compile with -O2 - does the snippet work?

I believe the problem is caused by r177113. This way -O2 should help you.

the stack, which is everything, will work.

Indeed. The caller correctly puts the argument into %ecx, however, the
callee expects to see it in %rdi (which is x86-64 calling convention).
Can you try to indicate the working commit?

Also, if you compile with -O2 - does the snippet work?

I believe the problem is caused by r177113. This way -O2 should help you.

This should be fixed as of revision 178549.

Chad