From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50288 invoked by alias); 8 Nov 2015 18:10:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 50256 invoked by uid 89); 8 Nov 2015 18:10:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f51.google.com Received: from mail-qg0-f51.google.com (HELO mail-qg0-f51.google.com) (209.85.192.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 08 Nov 2015 18:10:39 +0000 Received: by qgeb1 with SMTP id b1so74483405qge.1 for ; Sun, 08 Nov 2015 10:10:37 -0800 (PST) X-Received: by 10.140.233.15 with SMTP id e15mr26054593qhc.42.1447006237018; Sun, 08 Nov 2015 10:10:37 -0800 (PST) Received: from [192.168.0.26] (97-124-162-152.hlrn.qwest.net. [97.124.162.152]) by smtp.gmail.com with ESMTPSA id 76sm3304382qgo.32.2015.11.08.10.10.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2015 10:10:36 -0800 (PST) Message-ID: <563F901A.4080707@gmail.com> Date: Sun, 08 Nov 2015 18:10:00 -0000 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Andreas Schwab CC: Jason Merrill , Gcc Patch List Subject: Re: [PING 2] [PATCH] c++/67942 - diagnose placement new buffer overflow References: <561D3DEC.5090209@gmail.com> <5626D4D0.4010603@gmail.com> <562ED7E4.8030001@gmail.com> <56381EB8.4090708@redhat.com> <563A3C45.1060907@gmail.com> <563A58AB.608@redhat.com> <563A9FAD.2050807@gmail.com> <563ADAA2.9090702@redhat.com> <563B71F5.8030902@gmail.com> <563B7541.3010902@redhat.com> <563B8953.20901@gmail.com> <87d1vngum2.fsf@igel.home> In-Reply-To: <87d1vngum2.fsf@igel.home> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00855.txt.bz2 On 11/06/2015 05:50 AM, Andreas Schwab wrote: > I see this failure on m68k: > > FAIL: g++.dg/warn/Wplacement-new-size.C -std=gnu++11 (test for excess errors) > Excess errors: > /daten/aranym/gcc/gcc-20151106/gcc/testsuite/g++.dg/warn/Wplacement-new-size.C:189:19: warning: placement new constructing an object of type 'int' and size '4' in a region of type 'char [4]' and size '0' [-Wplacement-new] > /daten/aranym/gcc/gcc-20151106/gcc/testsuite/g++.dg/warn/Wplacement-new-size.C:191:19: warning: placement new constructing an object of type 'int' and size '4' in a region of type 'char [4]' and size '0' [-Wplacement-new] > /daten/aranym/gcc/gcc-20151106/gcc/testsuite/g++.dg/warn/Wplacement-new-size.C:194:19: warning: placement new constructing an object of type 'int' and size '4' in a region of type 'char [4]' and size '0' [-Wplacement-new] > /daten/aranym/gcc/gcc-20151106/gcc/testsuite/g++.dg/warn/Wplacement-new-size.C:198:19: warning: placement new constructing an object of type 'int' and size '4' in a region of type 'char [4]' and size '0' [-Wplacement-new] > > That appears to be a 32-bit problem, the test also fails here on x86-64 > with -m32 > or here on powerpc > This should be fixed now via r229959 (tested on x86_64 with -m32). The problem was caused by assuming that the POINTER_PLUS_EXPR offset which is stored as sizetype, an unsigned 32-bit type in ILP32, can be "extracted" as an unsigned HOST_WIDE_INT (a 64-bit type when the host compiler is LP64), and converted to signed to obtain the original negative offset. Martin