From: Richard Kenner Date: Mon, 1 Apr 1996 21:16:06 +0000 (-0500) Subject: (get_inner_reference): When finding mode to access bitfield that ends up properly... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e8621b3c1cbd3d2db673450c8744ab5a3457de28;p=gcc.git (get_inner_reference): When finding mode to access bitfield that ends up properly aligned... (get_inner_reference): When finding mode to access bitfield that ends up properly aligned, use mode class of its type unless type's mode was BLKmode. From-SVN: r11651 --- diff --git a/gcc/expr.c b/gcc/expr.c index c3328a16779..98f83e2aa1b 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -4150,7 +4150,12 @@ get_inner_reference (exp, pbitsize, pbitpos, poffset, pmode, access in case EXP is in memory. */ if (mode == VOIDmode && *pbitsize != 0 && *pbitpos % *pbitsize == 0) { - mode = mode_for_size (*pbitsize, MODE_INT, 0); + mode = mode_for_size (*pbitsize, + (TYPE_MODE (TREE_TYPE (orig_exp)) == BLKmode + ? MODE_INT + : GET_MODE_CLASS (TYPE_MODE + (TREE_TYPE (orig_exp)))), + 0); if (mode == BLKmode) mode = VOIDmode; }