From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 18A65385B835 for ; Thu, 9 Apr 2020 05:05:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 18A65385B835 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1545CABEA; Thu, 9 Apr 2020 05:05:29 +0000 (UTC) Subject: Re: [PATCH] Allow new/delete operator deletion only for replaceable. From: =?UTF-8?Q?Martin_Li=c5=a1ka?= To: Jason Merrill , Jakub Jelinek Cc: Jonathan Wakely , Marc Glisse , Nathan Sidwell , GCC Patches , Jan Hubicka References: <20200403152609.GA35629@kam.mff.cuni.cz> <0dbc191e-66f7-9878-956d-96149f20f5bf@suse.cz> <20200408133252.GG2212@tucnak> Message-ID: <20d175a6-23df-43e5-7027-d11fc660abd1@suse.cz> Date: Thu, 9 Apr 2020 07:05:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-15.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2020 05:05:33 -0000 Hi. We've got one another sneaky test-case (thank you Marc ;) ): $ cat pr94314-array.C #include #include int count = 0; __attribute__((malloc, noinline)) void* operator new[](unsigned long sz) { ++count; return ::operator new(sz); } void operator delete[](void* ptr) noexcept { --count; ::operator delete(ptr); } void operator delete[](void* ptr, std::size_t sz) noexcept { --count; ::operator delete(ptr, sz); } int main() { delete[] new int[1]; if (count != 0) __builtin_abort (); } I bet we need to include the Honza's fix for inline stacks. Or it the test-case invalid? Thanks, Martin