]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gimple.c (canonicalize_cond_expr_cond): Strip conversions around truth-valued express...
authorRichard Guenther <rguenther@suse.de>
Thu, 19 Nov 2009 15:45:48 +0000 (15:45 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 19 Nov 2009 15:45:48 +0000 (15:45 +0000)
2009-11-19  Richard Guenther  <rguenther@suse.de>

* gimple.c (canonicalize_cond_expr_cond): Strip conversions
around truth-valued expressions.
* tree.c (free_lang_data): Untangle check for LTO frontend.

From-SVN: r154332

gcc/ChangeLog
gcc/gimple.c
gcc/tree.c

index dec2c346e236463334470447354fe7b57972036d..e4923fceb8e70868aa1d21b11adf36cb81962365 100644 (file)
@@ -1,3 +1,9 @@
+2009-11-19  Richard Guenther  <rguenther@suse.de>
+
+       * gimple.c (canonicalize_cond_expr_cond): Strip conversions
+       around truth-valued expressions.
+       * tree.c (free_lang_data): Untangle check for LTO frontend.
+
 2009-11-19  Jakub Jelinek  <jakub@redhat.com>
 
        * tree.c (need_assembler_name_p): Use cgraph_get_node instead
index 676e3fd467852ca9c5e4f2e6a764c71dfca897bc..9cec865a728b9156da2f93b7ed1e076519b99333 100644 (file)
@@ -2937,9 +2937,14 @@ recalculate_side_effects (tree t)
 tree
 canonicalize_cond_expr_cond (tree t)
 {
+  /* Strip conversions around boolean operations.  */
+  if (CONVERT_EXPR_P (t)
+      && truth_value_p (TREE_CODE (TREE_OPERAND (t, 0))))
+    t = TREE_OPERAND (t, 0);
+
   /* For (bool)x use x != 0.  */
-  if (TREE_CODE (t) == NOP_EXPR
-      && TREE_TYPE (t) == boolean_type_node)
+  if (CONVERT_EXPR_P (t)
+      && TREE_CODE (TREE_TYPE (t)) == BOOLEAN_TYPE)
     {
       tree top0 = TREE_OPERAND (t, 0);
       t = build2 (NE_EXPR, TREE_TYPE (t),
index df24eb4ad593c9155bfb783e165b619272b0375d..76e23f7b74a40e00832552b58aeeca6714b47b3f 100644 (file)
@@ -4921,6 +4921,10 @@ free_lang_data (void)
 {
   unsigned i;
 
+  /* If we are the LTO frontend we have freed lang-specific data already.  */
+  if (in_lto_p)
+    return 0;
+
   /* Allocate and assign alias sets to the standard integer types
      while the slots are still in the way the frontends generated them.  */
   for (i = 0; i < itk_none; ++i)
@@ -4929,8 +4933,7 @@ free_lang_data (void)
 
   /* FIXME.  Remove after save_debug_info is working.  */
   if (!(flag_generate_lto
-       || (!in_lto_p
-           && !flag_gtoggle && debug_info_level <= DINFO_LEVEL_TERSE)))
+       || (!flag_gtoggle && debug_info_level <= DINFO_LEVEL_TERSE)))
     return 0;
 
   /* Traverse the IL resetting language specific information for