https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #18 from Alexander Monakov ---
Author: amonakov
Date: Mon Jul 30 12:26:37 2018
New Revision: 263065
URL: https://gcc.gnu.org/viewcvs?rev=263065=gcc=rev
Log:
doc: discourage const/volatile on register variables (PR 86673)
PR
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
Andrew Pinski changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #16 from Alexander Monakov ---
> I don't see what should we warn about.
I think the suggestion was to warn when a register const variable appears in
constraints, because the asm is not then guaranteed to receive that operand in
that
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #15 from Jakub Jelinek ---
register const void __user *__p asm("r0") = __ptr;
etc. isn't a problem, here __p isn't const, only *__p is. The problem is if
the register variable itself is const.
So
arch/h8300/kernel/sim-console.c:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
Alexander Monakov changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #13 from Arnd Bergmann ---
(In reply to Andreas Schwab from comment #12)
> arch/h8300/kernel/sim-console.c: register const int fd __asm__("er0") =
> 1;
I found that too, and then noticed it is already fixed in linux-next:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #12 from Andreas Schwab ---
arch/h8300/kernel/sim-console.c:register const int fd __asm__("er0") =
1; /* stdout */
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #11 from Arnd Bergmann ---
I have checked all instances of 'register const' or 'const register' in the
current linux kernel (4.18-rc), and we never assign a constant expression to
any of them, so I guess none of them are affected:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
Alexander Monakov changed:
What|Removed |Added
CC||amonakov at gcc dot gnu.org
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #9 from Arnd Bergmann ---
Reproduced on arm64 and x86 as well, see x86 version:
void fn1() {
register const int h asm("edx") = 1;
__asm__(".ifnc %0,edx; .err; .endif" :: "r"(h));
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #8 from Thomas Preud'homme ---
(In reply to Thomas Preud'homme from comment #7)
> (In reply to Thomas Preud'homme from comment #6)
> > The following simpler testcase also shows the problem:
> >
> > void fn1() {
> > register const
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #7 from Thomas Preud'homme ---
(In reply to Thomas Preud'homme from comment #6)
> The following simpler testcase also shows the problem:
>
> void fn1() {
> register const int h asm("r2") = 1;
> __asm__(".ifnc %0,r2; .err;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #6 from Thomas Preud'homme ---
The following simpler testcase also shows the problem:
void fn1() {
register const int h asm("r2") = 1;
__asm__(".ifnc %0,r2; .err; .endif\n\t"
"bl __put_user_4" :: "r"(h));
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #5 from Arnd Bergmann ---
(In reply to Andreas Schwab from comment #4)
> Why are you using empty constraints when a register is required?
creduce did that, it had no effect on the result. The original source looks
like:
#define
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #4 from Andreas Schwab ---
Why are you using empty constraints when a register is required?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
Ramana Radhakrishnan changed:
What|Removed |Added
Target||arm-none-linux-gnueabi ,
16 matches
Mail list logo