From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10511 invoked by alias); 19 May 2011 09:17:03 -0000 Received: (qmail 10453 invoked by uid 22791); 19 May 2011 09:17:02 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 May 2011 09:16:43 +0000 Received: by wye20 with SMTP id 20so2174840wye.20 for ; Thu, 19 May 2011 02:16:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.203.145 with SMTP id fi17mr2810134wbb.106.1305796602179; Thu, 19 May 2011 02:16:42 -0700 (PDT) Received: by 10.227.38.129 with HTTP; Thu, 19 May 2011 02:16:42 -0700 (PDT) In-Reply-To: References: Date: Thu, 19 May 2011 12:31:00 -0000 Message-ID: Subject: Re: [patch gimplifier]: Change TRUTH_(AND|OR|XOR) expressions to binary form From: Richard Guenther To: Kai Tietz Cc: GCC Patches , Eric Botcazou Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01360.txt.bz2 On Wed, May 18, 2011 at 8:30 PM, Kai Tietz wrote: > 2011/5/18 Kai Tietz : >> Hello >> >> As follow-up for logical to binary transition >> >> 2011-05-18 =A0Kai Tietz =A0 >> >> =A0 =A0 =A0 =A0* tree-cfg.c (verify_gimple_assign_binary): Barf on >> =A0 =A0 =A0 =A0TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR. >> =A0 =A0 =A0 =A0(gimplify_expr): Boolify TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXP= R, >> =A0 =A0 =A0 =A0TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR. Additi= onally >> =A0 =A0 =A0 =A0move TRUTH_AND|OR|XOR_EXPR to its binary form. >> >> Boostrapped for x86_64-pc-linux-gnu and regression tested for ada, >> fortran, g++, and c. Ok for apply? > > Additional bootstrapped and regression tested for java, obj-c, and > obj-c++. Regression tested alos libstdc++ and libjava. No regressions. Please put a comment before + + switch (TREE_CODE (*expr_p)) + { + case TRUTH_AND_EXPR: + TREE_SET_CODE (*expr_p, BIT_AND_EXPR); + break; + case TRUTH_OR_EXPR: + TREE_SET_CODE (*expr_p, BIT_IOR_EXPR); + break; + case TRUTH_XOR_EXPR: + TREE_SET_CODE (*expr_p, BIT_XOR_EXPR); + break; + default: + break; + } like /* With two-valued operand types binary truth expressions are semantically equivalent to bitwise binary expressions. Canonicalize them to the bitwise variant. */ Eric, how will this interact with Ada boolean types with 8 bit precision and those "invalid" values - will invalid values ever enter into expressions or are they checked before? Can you think of something that would break with s/TRUTH_*_EXPR/BIT_*_EXPR/ for Ada? Thanks, Richard. > Regards, > Kai >