From patchwork Wed Jul 13 07:36:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 104485 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id EE965B6F65 for ; Wed, 13 Jul 2011 17:36:47 +1000 (EST) Received: (qmail 25820 invoked by alias); 13 Jul 2011 07:36:44 -0000 Received: (qmail 25754 invoked by uid 22791); 13 Jul 2011 07:36:43 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jul 2011 07:36:29 +0000 Received: by qyk38 with SMTP id 38so3381875qyk.20 for ; Wed, 13 Jul 2011 00:36:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.17.17 with SMTP id q17mr680477qca.154.1310542588619; Wed, 13 Jul 2011 00:36:28 -0700 (PDT) Received: by 10.229.38.195 with HTTP; Wed, 13 Jul 2011 00:36:28 -0700 (PDT) Date: Wed, 13 Jul 2011 09:36:28 +0200 Message-ID: Subject: [patch 7/8 tree-optimization]: Bitwise not logic for fold_unary_loc. From: Kai Tietz To: GCC Patches Cc: Richard Guenther X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello, This patch adds support to fold_unary_loc for one-bit precision typed bitwise-not expression. ChangeLog 2011-07-13 Kai Tietz * fold-const.c (fold_unary_loc): Add support for one-bit bitwise-not optimizeation. Bootstrapped and regression tested with prior patches of this series for x86_64-pc-linux-gnu. Ok for apply? Regards, Kai Index: gcc/gcc/fold-const.c =================================================================== --- gcc.orig/gcc/fold-const.c 2011-07-13 08:49:50.000000000 +0200 +++ gcc/gcc/fold-const.c 2011-07-13 08:56:45.170171300 +0200 @@ -8094,6 +8094,12 @@ fold_unary_loc (location_t loc, enum tre if (i == count) return build_vector (type, nreverse (list)); } + if (INTEGRAL_TYPE_P (type) && TYPE_PRECISION (type) == 1) + { + tem = fold_truth_not_expr (loc, arg0); + if (tem) + return fold_convert_loc (loc, type, tem); + } return NULL_TREE;