From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23387 invoked by alias); 2 May 2002 12:18:30 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 23313 invoked from network); 2 May 2002 12:18:22 -0000 Received: from unknown (HELO freya.inter.net.il) (192.114.186.14) by sources.redhat.com with SMTP; 2 May 2002 12:18:22 -0000 Received: from dlivshin (diup-217-102.inter.net.il [213.8.217.102]) by freya.inter.net.il (Mirapoint Messaging Server MOS 2.9.3.2) with SMTP id BJS66971; Thu, 2 May 2002 15:17:59 +0300 (IDT) Message-ID: <000c01c1f1db$a589fc20$66d908d5@dlivshin> From: "David Livshin" To: "Richard Henderson" Cc: "Alan Lehotsky" , References: <001301c1f113$907bf540$91d808d5@dlivshin> <001301c1f1a4$0a0ae020$73d808d5@dlivshin> <20020501232220.A4494@redhat.com> Subject: Re: gcc port to StarCore Date: Thu, 02 May 2002 05:18:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-SW-Source: 2002-05/txt/msg00129.txt.bz2 ----- Original Message ----- From: Richard Henderson To: David Livshin Cc: Alan Lehotsky ; Sent: Thursday, May 02, 2002 8:22 AM Subject: Re: gcc port to StarCore > On Thu, May 02, 2002 at 08:38:23AM +0200, David Livshin wrote: > > However this doesn't seem to be the reason for the problem I have because > > the pattern: > > > > ( define_expand "cmpsi" > > No, the define_expand is irrelevant. It's the define_insn > that matters here. > > > r~ Are you saying that in order to benefit from constant propagation in the: x = 10; y = 100; if ( x > y ) ... 'define_expand "cmpsi"' may not be used? Would you please direct me to a material ( source code and/or document ) that may clarify the way this optimization is implemented by the GNU compiler. Right now I even cant guess what it might be. For example I tried in md: ( define_insn "addsi3" [ ( set ( match_operand:SI 0 "register_operand" "" ) ( plus:SI ( match_operand:SI 1 "general_operand" "" ) ( match_operand:SI 2 "general_operand" "" ) ) ) ] .... and then compiled: x = 10; y = 100; z = x + y; ... It seems from the resulting code: moveu.l #10,d0 move.l d0,_x moveu.l #100,d2 move.l d2,_y add #10,d2,d2 move.l d2,_z that compiler understands that 'x' is equal to 10 but misses the fact that 'y' is also a constant and 'z' is always equal to 110( or something inside the compiler forces the generation of the add instruction ). Just in-case you are wondering: description of "movsi" in my md file allows load of any constant to any register. Thank you, David