From 50a1960d1f5fabd82ac3c5d875121ff868016697 Mon Sep 17 00:00:00 2001 From: aoliva Date: Tue, 13 Oct 2015 16:34:29 +0000 Subject: [PATCH] support BLKmode inputs for store_bit_field Revision 228586 changed useless_type_conversion_p and added mode changes for MEM:BLKmode inputs in store_expr_with_bounds, but it missed store_bit_field. This caused ada/rts/s-regpat.ads to fail compilation on x86_64-linux-gnu. for gcc/ChangeLog PR middle-end/67912 * expmed.c (store_bit_field_1): Adjust mode of BLKmode inputs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228774 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/expmed.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e50e3732a0a..3ddc4a95e3d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-10-13 Alexandre Oliva + + PR middle-end/67912 + * expmed.c (store_bit_field_1): Adjust mode of BLKmode inputs. + 2015-10-12 Uros Bizjak * config/sparc/sparc.h (SPARC_STACK_ALIGN): Implement using diff --git a/gcc/expmed.c b/gcc/expmed.c index 93cf50822ae..69ea511a6f6 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -757,6 +757,14 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, } } + /* We allow move between structures of same size but different mode. + If source is in memory and the mode differs, simply change the memory. */ + if (GET_MODE (value) == BLKmode && GET_MODE (op0) != BLKmode) + { + gcc_assert (MEM_P (value)); + value = adjust_address_nv (value, GET_MODE (op0), 0); + } + /* Storing an lsb-aligned field in a register can be done with a movstrict instruction. */ -- 2.11.4.GIT