From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31694 invoked by alias); 8 Jan 2014 23:18:29 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 31682 invoked by uid 89); 8 Jan 2014 23:18:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_20,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f173.google.com Received: from mail-we0-f173.google.com (HELO mail-we0-f173.google.com) (74.125.82.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 08 Jan 2014 23:18:27 +0000 Received: by mail-we0-f173.google.com with SMTP id t60so2079280wes.4 for ; Wed, 08 Jan 2014 15:18:24 -0800 (PST) X-Received: by 10.194.142.142 with SMTP id rw14mr3929796wjb.87.1389223104108; Wed, 08 Jan 2014 15:18:24 -0800 (PST) Received: from [192.168.1.27] (45.Red-81-38-14.dynamicIP.rima-tde.net. [81.38.14.45]) by mx.google.com with ESMTPSA id d2sm11094919wik.11.2014.01.08.15.18.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 15:18:23 -0800 (PST) Message-ID: <52CDDCBD.5020802@gmail.com> Date: Wed, 08 Jan 2014 23:18:00 -0000 From: =?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?= User-Agent: Thunderbird MIME-Version: 1.0 To: rajkrishna CC: gcc-help@gcc.gnu.org Subject: Re: Generating Assembly Files Using GCC References: <1389008529517-1000051.post@n5.nabble.com> In-Reply-To: <1389008529517-1000051.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00028.txt.bz2 On 06/01/14 12:42, rajkrishna wrote: > We are using powerpc-motorola-elf-as.exe to generate assembly file from a > "*cpp*" file. If there is an if condition for eg *if(x==0)* , and when we > generate the assembly code for the condition ,"*bne*" and "*beq*" are > generated whereas only *beq *(branch equal) is the only code what we are > expecting as per the source code. Is there are any gcc switches which can be > used to customize the assembly code generation? You should provide a bigger example. Make a toy program with the if, show the original code, the generated assembly (only relevant lines needed, of course) and the expected one. What optimization level (-O) are you using? That's the most important switch changing the code generation (there are also switches to enable/disable individual optimizations, but -On works with groups of them). Please provide the command you are using to generate the assembly.