aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-10-25 19:29:10 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-10-25 19:29:10 +0000
commitf2be3ce484398bc0aa55714fa069fd1bbd61d894 (patch)
treec5d5d07a5dd6ae510ee695debbf6305c1e603568 /gcc/ada/gcc-interface
parent4d138338207c43831fb4de7e1183efbbcad1f517 (diff)
downloadgcc-f2be3ce484398bc0aa55714fa069fd1bbd61d894.zip
gcc-f2be3ce484398bc0aa55714fa069fd1bbd61d894.tar.gz
gcc-f2be3ce484398bc0aa55714fa069fd1bbd61d894.tar.bz2
utils2.c: Include flags.h and remove prototypes.
* 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
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in2
-rw-r--r--gcc/ada/gcc-interface/utils2.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 8af0895..578f9f2 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -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
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index c7db5a5..4c0853e 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -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"
@@ -47,11 +48,6 @@
#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);
-
/* 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: