public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch 7/8 tree-optimization]: Bitwise not logic for fold_unary_loc.
@ 2011-07-13  7:53 Kai Tietz
  2011-07-13 10:43 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Tietz @ 2011-07-13  7:53 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Guenther

Hello,

This patch adds support to fold_unary_loc for one-bit precision
typed bitwise-not expression.

ChangeLog

2011-07-13  Kai Tietz  <ktietz@redhat.com>

	* 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-13 10:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-13  7:53 [patch 7/8 tree-optimization]: Bitwise not logic for fold_unary_loc Kai Tietz
2011-07-13 10:43 ` Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).