This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR middle-end/37269: extract_bit_field_1 doesn't handle vector mode properly


On Thu, Aug 28, 2008 at 2:12 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Thu, Aug 28, 2008 at 2:08 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>
>> Hi,
>>
>> extract_bit_field_1 may call gen_lowpart to generate a V8SImode rtx from
>> a V8QImode rtx. This isn't valid even when V8SImode is a valid mode.
>> This patch replaces gen_lowpart with gen_lowpart_if_possible.  Tested
>> on Linux/ia32 and Linux/Intel64.  OK for trunk?
>
> I think there is a better patch to do this correctly is:
> Index: expmed.c
> ===================================================================
> --- expmed.c    (revision 2510)
> +++ expmed.c    (working copy)
> @@ -1129,7 +1129,7 @@ extract_bit_field (rtx str_rtx, unsigned
>        new_mode = MIN_MODE_VECTOR_INT;
>
>       for (; new_mode != VOIDmode ; new_mode = GET_MODE_WIDER_MODE (new_mode))
> -       if (GET_MODE_NUNITS (new_mode) == nunits
> +       if (GET_MODE_SIZE (new_mode) == GET_MODE_SIZE (new_mode)
>            && GET_MODE_INNER (new_mode) == tmode
>            && targetm.vector_mode_supported_p (new_mode))
>          break;
>
> Which is on my list of patches to submit soonish.

The issue here is that we were looking at the mode's units rather than
mode's size.

-- Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]