This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] set LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: zadeck at naturalbridge dot com
- Date: Thu, 13 Dec 2007 10:33:10 -0800
- Subject: [lto] set LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
Reason #4829 why langhooks should die. The comment is at Kenny's
request and is somewhat milder than Kenny's suggestion.
Fixes a number of bitfield-related tests in the testsuite.
Committed to the LTO branch.
-Nathan
gcc/
* langhooks.h (struct lang_hooks) Add comment for
reduce_bit_field_operations.
gcc/lto/
* lto-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define.
Index: gcc/langhooks.h
===================================================================
--- gcc/langhooks.h (revision 130903)
+++ gcc/langhooks.h (working copy)
@@ -319,7 +319,11 @@ struct lang_hooks
void (*set_decl_assembler_name) (tree);
/* Nonzero if operations on types narrower than their mode should
- have their results reduced to the precision of the type. */
+ have their results reduced to the precision of the type.
+
+ FIXME: This langhook is here purely for the convenience of C++;
+ somebody needs to figure out why C++ is so desperate to set this
+ differently than every other front-end and fix C++. */
bool reduce_bit_field_operations;
/* Nonzero if this front end does not generate a dummy BLOCK between
Index: gcc/lto/lto-lang.c
===================================================================
--- gcc/lto/lto-lang.c (revision 130903)
+++ gcc/lto/lto-lang.c (working copy)
@@ -573,6 +573,8 @@ lto_init (void)
#define LANG_HOOKS_PARSE_FILE lto_main
#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION tree_rest_of_compilation
+#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
+#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;