RE: PATCH: error on code that redeclares with an __asm__ label after the first ODR use

2015-12-11 Thread Gao, Yunzhong via cfe-commits
[mailto:meta...@gmail.com] On Behalf Of Richard Smith Sent: Friday, December 11, 2015 12:57 PM To: Gao, Yunzhong Cc: Nick Lewycky; Clang Commits Subject: Re: PATCH: error on code that redeclares with an __asm__ label after the first ODR use On Fri, Dec 11, 2015 at 12:43 PM, Gao, Yunzhong via cfe-commits

Re: PATCH: error on code that redeclares with an __asm__ label after the first ODR use

2015-12-11 Thread Richard Smith via cfe-commits
>>> >>> >>> void f(); >>> >>> void g() __asm__(“real_g”); // rename g into real_g. >>> >>> >>> >>> void f() { >>> >>> g(); // this would actually be calling real_g() >>> >>> } >>>

Re: PATCH: error on code that redeclares with an __asm__ label after the first ODR use

2015-12-11 Thread Nick Lewycky via cfe-commits
;t issue an error on the case Yunzhong actually supplied. Joerg has pointed out over IRC that this is a really useful construct and that NetBSD's stack smashing protection uses it. We shouldn't break that. I've added a testcase to make sure it continues working. Please review! Nick Lo

Re: PATCH: error on code that redeclares with an __asm__ label after the first ODR use

2015-12-11 Thread Richard Smith via cfe-commits
ose asm name is "real_g", and we have a function whose source-level name is "real_g()" and whose asm name is "gold". What's wrong with that? > Looks good to me. Thanks! > > - Gao > > > > > > *From:* Nick Lewycky [mailto:nlewy...@goo

RE: PATCH: error on code that redeclares with an __asm__ label after the first ODR use

2015-12-11 Thread Gao, Yunzhong via cfe-commits
...@google.com] Sent: Friday, December 11, 2015 12:44 AM To: Gao, Yunzhong Cc: Clang Commits Subject: Re: PATCH: error on code that redeclares with an __asm__ label after the first ODR use On 10 December 2015 at 17:42, Gao, Yunzhong mailto:yunzhong_...@playstation.sony.com>> wrote: Out of curiosi

Re: PATCH: error on code that redeclares with an __asm__ label after the first ODR use

2015-12-11 Thread Nick Lewycky via cfe-commits
;gold", but changing the asm label in a program is highly dubious. I added an error for this too. Thanks! > *From:* cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] *On > Behalf Of *Nick Lewycky via cfe-commits > *Sent:* Thursday, December 10, 2015 3:15 PM > *To:

PATCH: error on code that redeclares with an __asm__ label after the first ODR use

2015-12-10 Thread Nick Lewycky via cfe-commits
PR22830 shows a case where some code was adding an __asm__ label after the first use of a function. GCC and Clang diverged on this code, GCC emitting the name in the last __asm__ label for all uses while clang would switch in the middle of the TU as the redeclaration was parsed. The attached patch