Patchwork [1/8] Remove redundant BLKmode test

login
register
mail settings
Submitter Richard Sandiford
Date Oct. 30, 2012, 7:18 p.m.
Message ID <87ehkfixaf.fsf@talisman.home>
Download mbox | patch
Permalink /patch/195605/
State New
Headers show

Comments

Richard Sandiford - Oct. 30, 2012, 7:18 p.m.
This patch removes what I believe is a redundant check in store_bit_field_1
for whether the value to insert (i.e. the rhs) has BLKmode.  We shouldn't
see BLKmode values here, and even if we did, the only effect of the test
is to fall through to store_fixed_bit_field, which can't handle BLKmode
either.  Specifically, store_fixed_bit_field would call:

      if (GET_MODE (value) != mode)
	value = convert_to_mode (mode, value, 1);

and convert_to_mode ICEs on BLKmode values.

Tested as described in the covering note.  OK to install?

Richard


gcc/
	* expmed.c (store_bit_field_1): Remove test for BLKmode values.
Eric Botcazou - Oct. 30, 2012, 10 p.m.
> gcc/
> 	* expmed.c (store_bit_field_1): Remove test for BLKmode values.

This looks fine to me.
Richard Guenther - Oct. 31, 2012, 9:25 a.m.
On Tue, Oct 30, 2012 at 11:00 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> gcc/
>>       * expmed.c (store_bit_field_1): Remove test for BLKmode values.
>
> This looks fine to me.

Btw, I consider Eric the best person to approve changes in this area.
Thus if there is any doubt all patches in this series are ok if Eric
thinks they are ;)

Thanks,
Richard.

> --
> Eric Botcazou

Patch

Index: gcc/expmed.c
===================================================================
--- gcc/expmed.c	2012-10-28 10:40:22.533352589 +0000
+++ gcc/expmed.c	2012-10-28 10:40:23.119352588 +0000
@@ -670,7 +670,6 @@  store_bit_field_1 (rtx str_rtx, unsigned
 
   enum machine_mode op_mode = mode_for_extraction (EP_insv, 3);
   if (HAVE_insv
-      && GET_MODE (value) != BLKmode
       && bitsize > 0
       && GET_MODE_BITSIZE (op_mode) >= bitsize
       /* Do not use insv for volatile bitfields when