From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13479 invoked by alias); 26 Oct 2010 15:56:17 -0000 Received: (qmail 13458 invoked by uid 22791); 26 Oct 2010 15:56:15 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_LV X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Oct 2010 15:56:08 +0000 Received: by qwd6 with SMTP id 6so2648987qwd.20 for ; Tue, 26 Oct 2010 08:56:06 -0700 (PDT) Received: by 10.229.98.206 with SMTP id r14mr7953638qcn.162.1288108565963; Tue, 26 Oct 2010 08:56:05 -0700 (PDT) Received: from [10.5.180.2] ([166.205.138.98]) by mx.google.com with ESMTPS id mz11sm7467308qcb.15.2010.10.26.08.56.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 26 Oct 2010 08:56:05 -0700 (PDT) References: <4cc6e60b.2811970a.71aa.016aSMTPIN_ADDED@mx.google.com> Message-Id: <7F0406A6-2B6A-4230-8DCC-81A5F362BA58@gmail.com> From: Andrew Pinski To: "jak@jak-linux.org" In-Reply-To: <4cc6e60b.2811970a.71aa.016aSMTPIN_ADDED@mx.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (iPhone Mail 7E18) Subject: Re: [Bug c/46186] Clang creates code running 1600 times faster than gcc's Date: Tue, 26 Oct 2010 15:56:00 -0000 Cc: "gcc-bugs@gcc.gnu.org" X-IsSubscribed: yes 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: 2010-10/txt/msg02215.txt.bz2 On Oct 26, 2010, at 7:30 AM, "jak@jak-linux.org" wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46186 > > --- Comment #1 from Julian Andres Klode > 2010-10-26 14:30:24 UTC --- > Created attachment 22162 > --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22162 > Clang's assember This multiplication transformation is incorrect if the loop wraps (unsigned always wraps; never overflows). Gcc is correct in its speed. Though -O3 is faster but not because of multiplication but rather constant propatagtion. So this bug is invalid and some one should report a bug to llvm folks about this. > > Attaching the assembler output from clang, it should help understand > which > optimizations clang does (and improve gcc to do them as well).