<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I agree what you said about different code generated with clang and
GCC generates. In this case, we should throw an error
(err_late_asm_label).<br>
<br>
But in this example, there is no use of the function. They are just
redundant declarations and there is no actual code generated.<br>
So I suggest we just give warnings for this case. Otherwise, it will
break existing code like some SPEC benchmarks.<br>
<br>
Please review my 2nd patch.<br>
<br>
Weiming<br>
<br>
<div class="moz-cite-prefix">On 1/14/2016 2:28 PM, Nick Lewycky
wrote:<br>
</div>
<blockquote
cite="mid:CADbEz-iV5C9LopxWvSjJ2vHTPPdggZ0G+dAB8RgSQ_qFb1RnuQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On 14 January 2016 at 10:38, Weiming
Zhao via cfe-commits <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:cfe-commits@lists.llvm.org" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a></a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">weimingz
added a comment.<br>
<br>
Hi Nick,<br>
<br>
Below is a reduced code:<br>
t.c:<br>
<br>
static long double acoshl (long double __x) __asm__ (""
"acosh") ; // this is from
<gcc4.9>/arm-linux-gnueabi/libc/usr/include/bits/mathcalls.h<br>
extern long double acoshl (long double) __asm__ (""
"__acoshl_finite") ; // this is from existing code<br>
<br>
GCC gives warning like:<br>
/tmp/t.c:2:1: warning: asm declaration ignored due to
conflict with previous rename [-Wpragmas]<br>
extern long double acoshl (long double) __asm__ (""
"__acoshl_finite") ;<br>
</blockquote>
<div><br>
</div>
<div>
<div>That's the same case as in this testcase:</div>
<div><br>
</div>
<div> void foo() __asm__("one");</div>
<div> void foo() __asm__("two");<br>
</div>
<div> void test() { foo(); }<br>
</div>
<div><br>
</div>
<div>GCC emits a call to 'one' while Clang emits a call to
'two'. This is a real bug. Please don't downgrade this
to a warning.</div>
<div><br>
</div>
<div>As an alternative, I would accept a patch which
changes how clang generates code so that it also
produces a call to 'one', with a warning. It looks like
what we need to do is drop subsequent asm label
declarations on functions that already have one.</div>
<div><br>
</div>
<div>Nick</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>