This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix C++ testsuite failures.
Mark Mitchell <mark@codesourcery.com> writes:
| Gabriel Dos Reis wrote:
| > | - int * foo = &x; // in C++ it's perfectly legal to do this
| > | + int * foo = &x; // in C++ it's perfectly legal to do this {
| > | dg-warning "address requested" }
| >
| > I don't understand. The warning is bogus -- I think you should fill a
| > bugzilla PR for this.
|
| I don't think this is a bogus warning.
|
| The code is valid, but that doesn't make the warning in appropriate.
| The user has explicitly asked to take the address of a variable that is
| declared "register". The compiler is unable to honor the user's request
| that the variable live in a register because the variable needs to be
| addressable.
I'm not sue I follow. The semantics is that the variable is often used; not
that it leaves in a register and therefore cannot be addressed. That
has been so in C++ since before ARM era.
I believe there is a fundamental problem with the compiler in that
area; we already have a case where the compiler is a emitting such
warning even when the address is not taken.
| Thus, the compiler warns the user it is unable to comply
| with the "register" hint.
-- Gaby