From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1362 invoked by alias); 14 Nov 2012 13:37:36 -0000 Received: (qmail 1258 invoked by uid 22791); 14 Nov 2012 13:37:34 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Nov 2012 13:37:31 +0000 Received: by mail-pb0-f47.google.com with SMTP id ro12so346511pbb.20 for ; Wed, 14 Nov 2012 05:37:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.209.136 with SMTP id mm8mr77667183pbc.146.1352900250926; Wed, 14 Nov 2012 05:37:30 -0800 (PST) Received: by 10.68.153.196 with HTTP; Wed, 14 Nov 2012 05:37:30 -0800 (PST) Date: Wed, 14 Nov 2012 13:37:00 -0000 Message-ID: Subject: pr26180.c From: =?ISO-8859-1?Q?Andreas_Gei=DFler?= To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 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 X-SW-Source: 2012-11/txt/msg00106.txt.bz2 Hi. I need your help again. I wrote my own backend for the gcc-4.6.2 and it works nearly perfectly. But there is a problem with the test case pr26180.c. In this special case the register (r8), which is used for the comparison, is not loaded. And i don't get why. C-Code (pr26180.c): ... x2 = ((x > 0)? (x): -(x)); ... Wrong translated assembler code: ... ;x > 0? cmpi.l r8,-2147483648 <- r8 is not used in the hole function and so it is not initialized with x jmp C,_L2 xori.l r8,-1 addi.l r8,1 _L2: ... If i only change the comparison integer from 0 to 1 all works fine: C-Code: ... x2 = (x > 1 ? x : (-x)); ... Translated assembler code: ... ;load r8 mov.l r8,fp addi.l r8,4 mov.l r9,r8 ldr.l r8,r9 ;x > 1? cmpi.l r8,-1 jmpn N,_L2 ;x2 = -x mov.l r8,fp addi.l r8,4 mov.l r9,r8 ldr.l r8,r9 xori.l r8,-1 addi.l r8,1 jmp T,_L3 _L2: ;x2 = x mov.l r8,fp addi.l r8,4 mov.l r9,r8 ldr.l r8,r9 _L3: ... So i you would like to ask you, which special pattern (machine description pattern (*.md)) is related to "x2 = ((x > 0)? (x): -(x));" or where should i search the problem.