This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33887] [4.1/4.2/4.3 Regression] Reference to bitfield gets wrong value when optimizing
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Dec 2007 15:55:08 -0000
- Subject: [Bug c++/33887] [4.1/4.2/4.3 Regression] Reference to bitfield gets wrong value when optimizing
- References: <bug-33887-1313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from rguenth at gcc dot gnu dot org 2007-12-11 15:55 -------
The following fixes this failure, but breaks libjava a lot:
Index: cp/cp-lang.c
===================================================================
--- cp/cp-lang.c (revision 130773)
+++ cp/cp-lang.c (working copy)
@@ -54,6 +54,8 @@ static const char * cxx_dwarf_name (tree
#define LANG_HOOKS_FOLD_OBJ_TYPE_REF cp_fold_obj_type_ref
#undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS cp_init_ts
+#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
+#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true
/* Each front end provides its own lang hook initializer. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
but if that is not the correct fix, then the IL emitted by the frontend
for the increment
<<cleanup_point <<< Unknown tree: expr_stmt
(void) ++sv.f2 >>>
>>;
or its gimplification (for !reduce_bit_field_operations languages)
<unnamed-unsigned:24> D.2024;
<unnamed-unsigned:24> D.2025;
...
D.2024 = sv.f2;
D.2025 = D.2024 + 1;
sv.f2 = D.2025;
is wrong.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33887