From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13266 invoked by alias); 17 Sep 2008 16:12:29 -0000 Received: (qmail 10586 invoked by uid 48); 17 Sep 2008 16:11:20 -0000 Date: Wed, 17 Sep 2008 16:12:00 -0000 Message-ID: <20080917161120.10585.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug testsuite/37561] [4.4 Regression] Revision 140405 caused g++.old-deja/g++.mike/warn1.C In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "hjl dot tools at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-09/txt/msg02050.txt.bz2 ------- Comment #2 from hjl dot tools at gmail dot com 2008-09-17 16:11 ------- (In reply to comment #1) > I tested with -m32 on powerpc64-linux, not with both -m32/-m64 which would have > caught this; I'll test with both for related patches. > > The test previously used { dg-warning "" }, which matched any message from that > line. The patch, in preparation to using new versions of dg-error and > dg-warning that actually check for "warning" and "error", changed that to { > dg-error "lvalue" }, which matches the error message for -m32 but not the > warning message for -m64. It's a bug in the compiler that the error isn't > reported for -m64, and the change to the test merely detected that. > > This should be a C++ bug, not a testsuite bug. > I am not sure if it is a C++ bug. The differences between -m32 and -m64 are the sizes of __SIZE_TYPE__, int and pointer. Replace int with long gives me [hjl@gnu-6 tmp]$ cat x.cc typedef char * charptr; typedef __SIZE_TYPE__ size_t; char c[]={'A','B','C','D'}; long i=size_t(&c); long *pp=&i; void foo() { } int main() { charptr(*pp)++; // { dg-warning "" } return 0; } [hjl@gnu-6 tmp]$ gcc -Wall x.cc -S -m64 x.cc: In function ‘int main()’: x.cc:9: error: lvalue required as increment operand [hjl@gnu-6 tmp]$ gcc -Wall x.cc -S -m32 x.cc: In function ‘int main()’: x.cc:9: error: lvalue required as increment operand [hjl@gnu-6 tmp]$ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37561