This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix gcc_assert if WORDS_BIG_ENDIAN != BYTES_BIG_ENDIAN
- From: Paul Koning <Paul_Koning at dell dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Oct 2010 14:04:32 -0400
- Subject: [PATCH] Fix gcc_assert if WORDS_BIG_ENDIAN != BYTES_BIG_ENDIAN
This patch fixes a gcc_assert in platforms (pdp11 is the one I know of) where BYTES_BIG_ENDIAN differs from WORDS_BIG_ENDIAN.
The problem is that I end up with HI mode subreg references to odd bytes, which cause a gcc_assert. It appears to me that this patch is needed.
This was approved earlier by Richard Henderson.
Bootstrapped on linux-x86 and "make check" run, no regressions.
paul
ChangeLog:
2010-10-19 Paul Koning <pkoning@equallogic.com>
* lower-subreg.c (resolve_shift_zext): Delete conditional code for
WORDS_BIG_ENDIAN != BYTES_BIG_ENDIAN.
Index: lower-subreg.c
===================================================================
--- lower-subreg.c (revision 165191)
+++ lower-subreg.c (working copy)
@@ -1008,13 +1008,6 @@
offset2 = UNITS_PER_WORD * (1 - dest_reg_num);
src_offset = UNITS_PER_WORD * src_reg_num;
- if (WORDS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
- {
- offset1 += UNITS_PER_WORD - 1;
- offset2 += UNITS_PER_WORD - 1;
- src_offset += UNITS_PER_WORD - 1;
- }
-
start_sequence ();
dest_reg = simplify_gen_subreg_concatn (word_mode, SET_DEST (set),