utils2.c: Include flags.h and remove prototypes.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 25 Oct 2010 19:29:10 +0000 (19:29 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 25 Oct 2010 19:29:10 +0000 (19:29 +0000)
* gcc-interface/utils2.c: Include flags.h and remove prototypes.
(build_unary_op) <TRUTH_NOT_EXPR>: When not optimizing, fold the result
of the call to invert_truthvalue_loc.
* gcc-interface/Make-lang.in (utils2.o): Add $(FLAGS_H).

From-SVN: r165928

gcc/ada/ChangeLog
gcc/ada/gcc-interface/Make-lang.in
gcc/ada/gcc-interface/utils2.c

index b5162f79c8749028d41488a97eeda0529e0dad38..3ab14974838a30699d08c2bb92705ba87021bbbd 100644 (file)
@@ -1,3 +1,10 @@
+2010-10-25  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/utils2.c: Include flags.h and remove prototypes.
+       (build_unary_op) <TRUTH_NOT_EXPR>: When not optimizing, fold the result
+       of the call to invert_truthvalue_loc.
+       * gcc-interface/Make-lang.in (utils2.o): Add $(FLAGS_H).
+
 2010-10-25  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/utils.c (update_pointer_to): Clear TYPE_POINTER_TO and
index 8af0895fd2fb2fbd4ffd27a0ed399d2a1abe7cc3..578f9f26faa281499ed48a724582a1836c135323 100644 (file)
@@ -1264,7 +1264,7 @@ ada/utils.o : ada/gcc-interface/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
        $(COMPILER) -c $(ALL_COMPILERFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
 
 ada/utils2.o : ada/gcc-interface/utils2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
-   $(TM_H) $(TREE_H) output.h $(TREE_INLINE_H) \
+   $(TM_H) $(TREE_H) $(FLAGS_H) output.h $(TREE_INLINE_H) \
    ada/gcc-interface/ada.h ada/types.h ada/atree.h ada/elists.h ada/namet.h \
    ada/nlists.h ada/snames.h ada/stringt.h ada/uintp.h ada/fe.h ada/sinfo.h \
    ada/einfo.h $(ADA_TREE_H) ada/gcc-interface/gigi.h
index c7db5a5f20457ff36dd6fe3d806bf22141099bb6..4c0853ea0ffbdf95c1d35671d953b1e628b94f96 100644 (file)
@@ -28,6 +28,7 @@
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
+#include "flags.h"
 #include "ggc.h"
 #include "output.h"
 #include "tree-inline.h"
 #include "ada-tree.h"
 #include "gigi.h"
 
-static tree find_common_type (tree, tree);
-static tree compare_arrays (tree, tree, tree);
-static tree nonbinary_modular_operation (enum tree_code, tree, tree, tree);
-static tree build_simple_component_ref (tree, tree, tree, bool);
-\f
 /* Return the base type of TYPE.  */
 
 tree
@@ -1024,6 +1020,11 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
       gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
 #endif
       result = invert_truthvalue_loc (EXPR_LOCATION (operand), operand);
+      /* When not optimizing, fold the result as invert_truthvalue_loc
+        doesn't fold the result of comparisons.  This is intended to undo
+        the trick used for boolean rvalues in gnat_to_gnu.  */
+      if (!optimize)
+       result = fold (result);
       break;
 
     case ATTR_ADDR_EXPR: