From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8614 invoked by alias); 18 Aug 2014 15:19:51 -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 8282 invoked by uid 48); 18 Aug 2014 15:19:39 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/62156] memcmp doesn't see through memcpy at compile-time Date: Mon, 18 Aug 2014 15:19: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: 5.0 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-08/txt/msg01216.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62156 --- Comment #3 from Marc Glisse --- Not much difference using __gnu_cxx::__vstring (no reference counting, small string optimization): __builtin_memcpy (&MEM[(struct __sso_string_base *)&D.28720].D.23707._M_local_data, "foo", 3); MEM[(size_type *)&D.28720 + 8B] = 3; MEM[(char_type &)&D.28720 + 19] = 0; __r_46 = __builtin_memcmp (&MEM[(struct __sso_string_base *)&D.28720].D.23707._M_local_data, "bar", 3);