public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57392] New: The result of a .* expression is rvalue in a function template when its object expression is lvalue.
@ 2013-05-24  6:27 kyusic at gmail dot com
  2013-05-24  9:17 ` [Bug c++/57392] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kyusic at gmail dot com @ 2013-05-24  6:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57392

            Bug ID: 57392
           Summary: The result of a .* expression is rvalue in a function
                    template when its object expression is lvalue.
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kyusic at gmail dot com

Created attachment 30178
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30178&action=edit
preprocessed source

g++ rejects the following program in c++11 mode:

-------------- begin -------------
struct A
{
    int i;
};

void g(int& p) {}

template <typename T>
void f()
{
    A a;
    int A::*pm = &A::i;
    g(a.*pm); // (*)
}
------------- end ----------------

It says the expression 'a.*pm' at the line marked with (*) is rvalue, which
should be lvalue because its object expression 'a' is lvalue.

It compiles fine when f() is not templated.

g++-4.8.0 has the same problem.

Following is the compiler message:

------------- begin ----------------
$ g++ -v -save-temps -c -std=c++11 a.cc
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7.3/configure --enable-languages=c++
--disable-multilib
Thread model: posix
gcc version 4.7.3 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-std=c++11' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.7.3/cc1plus -E -quiet -v
-imultilib . -imultiarch x86_64-linux-gnu -D_GNU_SOURCE a.cc -mtune=generic
-march=x86-64 -std=c++11 -fpch-preprocess -o a.ii
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/x86_64-unknown-linux-gnu/.

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/backward
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/include
 /usr/local/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-std=c++11' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.7.3/cc1plus -fpreprocessed
a.ii -quiet -dumpbase a.cc -mtune=generic -march=x86-64 -auxbase a -std=c++11
-version -o a.s
GNU C++ (GCC) version 4.7.3 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.7.3, GMP version 5.0.5, MPFR version 3.1.1-p2,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.7.3 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.7.3, GMP version 5.0.5, MPFR version 3.1.1-p2,
MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: e27c3e349c650e830c6a08a9bf1d2e03
a.cc: In function ‘void f()’:
a.cc:13:12: error: invalid initialization of non-const reference of type ‘int&’
from an rvalue of type ‘int’
a.cc:6:6: error: in passing argument 1 of ‘void g(int&)’
---------------------- end ----------------------
>From gcc-bugs-return-423011-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 24 06:33:50 2013
Return-Path: <gcc-bugs-return-423011-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20065 invoked by alias); 24 May 2013 06:33:50 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 20014 invoked by uid 48); 24 May 2013 06:33:42 -0000
From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/57393] New: [4.8 Regression] error: definition in block 4 follows the use / internal compiler error: verify_ssa failed
Date: Fri, 24 May 2013 06:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created
Message-ID: <bug-57393-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-05/txt/msg01684.txt.bz2
Content-length: 1539

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57393

            Bug ID: 57393
           Summary: [4.8 Regression] error: definition in block 4 follows
                    the use / internal compiler error: verify_ssa failed
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Joost.VandeVondele at mat dot ethz.ch

Created attachment 30179
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30179&action=edit
testcase

With current trunk:

gfortran -c -g -O2 -ffast-math  -ffree-form -cpp bug.f90

bug.f90: In function ‘xb88_lr_adiabatic_lda_calc’:
bug.f90:1:0: error: definition in block 4 follows the use
   SUBROUTINE xb88_lr_adiabatic_lda_calc(rho, norm_drho,&
 ^
for SSA_NAME: _83 in statement:
# DEBUG D#20 => _83 + _54
bug.f90:1:0: internal compiler error: verify_ssa failed
0xb37624 verify_ssa(bool)
    ../../gcc/gcc/tree-ssa.c:1046
0x903f12 execute_function_todo
    ../../gcc/gcc/passes.c:1970
0x90486d execute_todo
    ../../gcc/gcc/passes.c:2002
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


Since the testcase is actually a reduced version of PR57370 the bug could be
related. However, since this one is ICE-ing while the other hangs, I'm assuming
this is a different issue.
>From gcc-bugs-return-423012-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 24 06:34:35 2013
Return-Path: <gcc-bugs-return-423012-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20828 invoked by alias); 24 May 2013 06:34:35 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 20802 invoked by uid 48); 24 May 2013 06:34:32 -0000
From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/57393] [4.9 Regression] error: definition in block 4 follows the use / internal compiler error: verify_ssa failed
Date: Fri, 24 May 2013 06:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc short_desc
Message-ID: <bug-57393-4-60arPo6uMn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57393-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57393-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-05/txt/msg01685.txt.bz2
Content-length: 855

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW393

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Joost.VandeVondele at mat dot ethz
                   |                            |.ch
            Summary|[4.8 Regression] error:     |[4.9 Regression] error:
                   |definition in block 4       |definition in block 4
                   |follows the use / internal  |follows the use / internal
                   |compiler error: verify_ssa  |compiler error: verify_ssa
                   |failed                      |failed

--- Comment #1 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
fine with 4.8 fails with 4.9


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/57392] The result of a .* expression is rvalue in a function template when its object expression is lvalue.
  2013-05-24  6:27 [Bug c++/57392] New: The result of a .* expression is rvalue in a function template when its object expression is lvalue kyusic at gmail dot com
@ 2013-05-24  9:17 ` redi at gcc dot gnu.org
  2013-05-24 13:17 ` daniel.kruegler at googlemail dot com
  2021-08-02  0:35 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2013-05-24  9:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57392

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-05-24
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/57392] The result of a .* expression is rvalue in a function template when its object expression is lvalue.
  2013-05-24  6:27 [Bug c++/57392] New: The result of a .* expression is rvalue in a function template when its object expression is lvalue kyusic at gmail dot com
  2013-05-24  9:17 ` [Bug c++/57392] " redi at gcc dot gnu.org
@ 2013-05-24 13:17 ` daniel.kruegler at googlemail dot com
  2021-08-02  0:35 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-05-24 13:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57392

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
Sam problem exists for gcc 4.9.0 20130519 (experimental) as well
>From gcc-bugs-return-423059-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri May 24 13:18:54 2013
Return-Path: <gcc-bugs-return-423059-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29032 invoked by alias); 24 May 2013 13:18:54 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 28985 invoked by uid 48); 24 May 2013 13:18:51 -0000
From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/57393] [4.9 Regression] error: definition in block 4 follows the use / internal compiler error: verify_ssa failed
Date: Fri, 24 May 2013 13:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: dependson
Message-ID: <bug-57393-4-aciciJQYRZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57393-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57393-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-05/txt/msg01732.txt.bz2
Content-length: 488

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW393

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |57337

--- Comment #3 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
(In reply to Igor Zamyatin from comment #2)
> Dup of PR57337?

Likely so. I'll add a dependency


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/57392] The result of a .* expression is rvalue in a function template when its object expression is lvalue.
  2013-05-24  6:27 [Bug c++/57392] New: The result of a .* expression is rvalue in a function template when its object expression is lvalue kyusic at gmail dot com
  2013-05-24  9:17 ` [Bug c++/57392] " redi at gcc dot gnu.org
  2013-05-24 13:17 ` daniel.kruegler at googlemail dot com
@ 2021-08-02  0:35 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-02  0:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57392

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=61500
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |4.8.4
         Resolution|---                         |FIXED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 4.8.4, 4.9.1 and 5+ by the patch which fixed PR 61500.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-02  0:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-24  6:27 [Bug c++/57392] New: The result of a .* expression is rvalue in a function template when its object expression is lvalue kyusic at gmail dot com
2013-05-24  9:17 ` [Bug c++/57392] " redi at gcc dot gnu.org
2013-05-24 13:17 ` daniel.kruegler at googlemail dot com
2021-08-02  0:35 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).