From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26408 invoked by alias); 4 Jun 2014 06:21:21 -0000 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 Received: (qmail 26356 invoked by uid 48); 4 Jun 2014 06:21:15 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/58483] missing optimization opportunity for const std::vector compared to std::array Date: Wed, 04 Jun 2014 06:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: glisse at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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: 2014-06/txt/msg00238.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483 --- Comment #8 from Marc Glisse --- (In reply to dennis luehring from comment #7) [clang] > void *__builtin_operator_new(size_t) > void __builtin_operator_delete(void*) I don't understand why N3664 is talking of new expressions instead of operator new calls, it doesn't give any rationale for that choice, and we get duplicate wording between the description of new expressions and std::allocator::allocate. But at least it explains why they have these builtins (which at first sight is strange since they don't have __builtin_malloc). > gcc seems to have removed these long time ago and i currently do understand > whats gcc solution could be We may add a compilation flag that promises the user won't try to replace the main operator new / operator delete. The compiler could then inline them (either LTO or make an inlined version available), see malloc + free, and hopefully simplify that. We may also introduce those 2 builtins. Anyway, the first priority is simplifying the rest until there are just the calls to new+delete left. That's not currently the case.