public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kyusic at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57392] New: The result of a .* expression is rvalue in a function template when its object expression is lvalue. Date: Fri, 24 May 2013 06:27:00 -0000 [thread overview] Message-ID: <bug-57392-4@http.gcc.gnu.org/bugzilla/> (raw) 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
next reply other threads:[~2013-05-24 6:27 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-05-24 6:27 kyusic at gmail dot com [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-57392-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).