From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16686 invoked by alias); 4 Apr 2012 16:35:38 -0000 Received: (qmail 16574 invoked by uid 22791); 4 Apr 2012 16:35:37 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Apr 2012 16:35:24 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/52861] (missed optimisation) missed transformation to memset with -O3 Date: Wed, 04 Apr 2012 16:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: minor X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords CC Component Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-04/txt/msg00298.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52861 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization CC| |burnus at gcc dot gnu.org Component|fortran |middle-end --- Comment #1 from Tobias Burnus 2012-04-04 16:35:18 UTC --- Regarding the first test cases: For qq1.f, the loop remains and one gets in the loop: MEM[base: isu_34(D), index: ivtmp.19_49, step: 4, offset: 0B] = 0; __builtin_memcpy (D.1901_38, &" "[0], 8); MEM[base: rsv_45(D), index: ivtmp.19_49, step: 4, offset: 0B] = 0.0; For qq2, the first loop is replaced by: __builtin_memset (isu_35(D), 0, D.1935_54); __builtin_memset (rsv_38(D), 0, D.1935_54); while for the character string, the loop is kept. For the rather common (Fortran) case of assigning blanks (" ") to a string (cf. also the third test case), it would be good to replace the loop __builtin_memcpy (D.1909_46, &" "[0], 8); by (outside the loop) __builtin_memset (D.1909_46, " ", *);