This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR middle-end/37269: extract_bit_field_1 doesn't handle vector mode properly
- From: "Andrew Pinski" <pinskia at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, "Joey Ye" <joey dot ye at intel dot com>, "Xuepeng Guo" <xuepeng dot guo at intel dot com>
- Date: Thu, 28 Aug 2008 14:12:54 -0700
- Subject: Re: PATCH: PR middle-end/37269: extract_bit_field_1 doesn't handle vector mode properly
- References: <20080828210831.GA12504@lucon.org>
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.
-- Pinski