From: Richard Guenther Date: Fri, 4 Mar 2011 10:31:33 +0000 (+0000) Subject: re PR middle-end/47968 (ICE: in gen_lowpart_general, at rtlhooks.c:51 when converting... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b147c5b92f3bbcda3d5d464d65bdf76e666c34a5;p=gcc.git re PR middle-end/47968 (ICE: in gen_lowpart_general, at rtlhooks.c:51 when converting vector of double to vector of float) 2011-03-04 Richard Guenther PR middle-end/47968 * expmed.c (extract_bit_field_1): Prefer vector modes that vec_extract patterns can handle. * gcc.dg/torture/pr47968.c: New testcase. From-SVN: r170673 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a968fe7449e..9c4631aa50c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-03-04 Richard Guenther + + PR middle-end/47968 + * expmed.c (extract_bit_field_1): Prefer vector modes that + vec_extract patterns can handle. + 2011-03-04 Richard Guenther PR middle-end/47975 diff --git a/gcc/expmed.c b/gcc/expmed.c index f17abb53568..b0c1e235dd7 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -1205,7 +1205,6 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, && GET_MODE_INNER (GET_MODE (op0)) != tmode) { enum machine_mode new_mode; - int nunits = GET_MODE_NUNITS (GET_MODE (op0)); if (GET_MODE_CLASS (tmode) == MODE_FLOAT) new_mode = MIN_MODE_VECTOR_FLOAT; @@ -1221,8 +1220,7 @@ extract_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, 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 - && GET_MODE_SIZE (new_mode) == GET_MODE_SIZE (GET_MODE (op0)) + if (GET_MODE_SIZE (new_mode) == GET_MODE_SIZE (GET_MODE (op0)) && targetm.vector_mode_supported_p (new_mode)) break; if (new_mode != VOIDmode) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c1054228575..e49bd7953de 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-03-04 Richard Guenther + + PR middle-end/47968 + * gcc.dg/torture/pr47968.c: New testcase. + 2011-03-04 Richard Guenther PR middle-end/47975 diff --git a/gcc/testsuite/gcc.dg/torture/pr47968.c b/gcc/testsuite/gcc.dg/torture/pr47968.c new file mode 100644 index 00000000000..5d60a0f4c7b --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr47968.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ + +typedef __attribute__ ((vector_size (16))) float float4; +typedef __attribute__ ((vector_size (16))) double double2; + +float foo (double2 d2) +{ + float4 f4 = (float4) d2; + return *(float *) &f4; +} +