Open Quuxplusone opened 11 years ago
Bugzilla Link | PR14408 |
Status | NEW |
Importance | P enhancement |
Reported by | Zhenbo Xu (zhenbo1987@gmail.com) |
Reported on | 2012-11-22 01:42:59 -0800 |
Last modified on | 2015-08-18 20:53:36 -0700 |
Version | trunk |
Hardware | PC Linux |
CC | anton@korobeynikov.info, jtony@ca.ibm.com, llvm-bugs@lists.llvm.org, pawel@32bitmicro.com, rafael@espindo.la |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
The error is correct per se. The code is buggy and needs to be fixed.
The code is from linux kernel 3.5.4. gcc don't generate this error.
(In reply to comment #1)
> The error is correct per se. The code is buggy and needs to be fixed.
The test case here is indeed buggy. Because it is not good to cast long to int.
However, I met a similar problem. Clang cannot cast int to long, which I think
can be improved. The test case is as follows:
void VALGRIND_PRINTF(const char *format, ...)
{
unsigned long _qzz_res = ({
unsigned long long int _zzq_result;
__asm__ volatile("lgr 3,%1"
: "=d" (_zzq_result)
: "0" (0)
);
_zzq_result; });
}
error: unsupported inline asm: input with type 'int' matching output with type
'volatile unsigned long long'
: "0" (0)
^
In this case, if we can cast 0 to unsigned long long int, there will be no
error.