Summary: | [3.4/4.0 regression] Spurious warnings on conversion of pointers to member functions | ||
---|---|---|---|
Product: | gcc | Reporter: | Joe Buck <jbuck> |
Component: | c++ | Assignee: | Mark Mitchell <mark> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, mmitchel |
Priority: | P2 | Keywords: | diagnostic |
Version: | 3.4.0 | ||
Target Milestone: | 3.4.0 | ||
Host: | Target: | ||
Build: | Known to work: | 2.95.3 3.2.3 3.3.3 | |
Known to fail: | 3.4.0 4.0.0 tree-ssa | Last reconfirmed: | 2004-03-31 23:51:07 |
Attachments: | test case |
Description
Joe Buck
2004-03-31 23:44:45 UTC
Created attachment 6021 [details]
test case
Confirmed. The warning message is a) not justified, and b) profoundly unhelpful! W. For some reason the expression has an overflow: <integer_cst 0x401360a0 type <integer_type 0x400505e8 int> constant static overflow -4> At typeck.c:5497 (in build_ptrmemfunc, at the assert) n is <nop_expr 0x417dc5c0 type <integer_type 0x417108b8 int SI size <integer_cst 0x4170e360 constant invariant 32> unit size <integer_cst 0x4170e400 constant invariant 4> align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0x4170e3c0 -2147483648> max <integer_cst 0x4170e3e0 2147483647> pointer_to_this <pointer_type 0x4171d7c0>> constant invariant arg 0 <integer_cst 0x41790780 type <integer_type 0x4171d174> constant invariant -4>> and delta is: <nop_expr 0x417dc5e0 type <integer_type 0x417108b8 int SI size <integer_cst 0x4170e360 constant invariant 32> unit size <integer_cst 0x4170e400 constant invariant 4> align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0x4170e3c0 -2147483648> max <integer_cst 0x4170e3e0 2147483647> pointer_to_this <pointer_type 0x4171d7c0>> constant invariant arg 0 <integer_cst 0x4170ea80 type <integer_type 0x4171d000 long unsigned int> constant invariant 0>> So when they are added together it sets the overflow bit for some reason (maybe setting the overflow bit to 0 will work). Working on a fix. Subject: Bug 14803 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2004-04-01 23:14:56 Modified files: gcc/cp : ChangeLog typeck.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/inherit: ptrmem1.C Log message: PR c++/14803 * typeck.c (get_delta_difference): Call fold before returning the value. PR c++/14803 * g++.dg/inherit/ptrmem1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4024&r2=1.4025 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.538&r2=1.539 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3649&r2=1.3650 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/ptrmem1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 Fixed in GCC 3.4. Subject: Bug 14803 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: mmitchel@gcc.gnu.org 2004-04-01 23:18:23 Modified files: gcc/cp : ChangeLog typeck.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/inherit: ptrmem1.C Log message: PR c++/14803 * typeck.c (get_delta_difference): Call fold before returning the value. PR c++/14803 * g++.dg/inherit/ptrmem1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.93&r2=1.3892.2.94 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.519.2.13&r2=1.519.2.14 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.160&r2=1.3389.2.161 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/ptrmem1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1 |