Patchwork Fix gcc_assert if WORDS_BIG_ENDIAN != BYTES_BIG_ENDIAN

login
register
mail settings
Submitter Paul Koning
Date Oct. 19, 2010, 6:04 p.m.
Message ID <CDC26C2F-FADF-457A-9AD0-975E028A5B05@dell.com>
Download mbox | patch
Permalink /patch/68366/
State New
Headers show

Comments

Paul Koning - Oct. 19, 2010, 6:04 p.m.
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.

Patch

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),