: [PATCH, reginfo.c, i386.c] Backport fix for PR58139 to 4.8

Uros Bizjak ubizjak@gmail.com
Thu Jan 16 08:11:00 GMT 2014


On Wed, Jan 15, 2014 at 2:19 PM, Peter Bergner <bergner@vnet.ibm.com> wrote:
> Oops, forgot to CC the x86 maintainers.  Is the i386.c change ok for 4.8?
>
> Peter
>
>
> -------- Forwarded Message --------
> From: Peter Bergner <bergner@vnet.ibm.com>
> To: gcc-patches@gcc.gnu.org <gcc-patches@gcc.gnu.org>
> Cc: Richard Biener <richard.guenther@gmail.com>, Jakub Jelinek <jakub@redhat.com>, Vladimir Makarov <vmakarov@redhat.com>
> Subject: [PATCH, reginfo.c, i386.c] Backport fix for PR58139 to 4.8
> Date: Tue, 14 Jan 2014 11:22:13 -0600
>
> The mainline fix for PR58139 which is a wrong code gen bug was
> submitted here:
>
>     http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00910.html
>
> and approved for mainline and 4.8 (after a few weeks) here:
>
>     http://gcc.gnu.org/ml/gcc-patches/2013-09/msg00134.html
>
> However, my fix exposed a latent x86 bug, so this patch was never
> committed to 4.8.  The latent x86 bug was fixed by Honza and I'd
> like to now ask to be able to backport my fix for PR58139 along
> with Honza's fix to 4.8.
>
> This passed bootstrap and regtesting on powerpc64-linux and
> I bootstrapped this on x86_64 and verified that the ICE seen
> when compiling the test case with only my patch in:
>
>     http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269#c2
>
> is fixed when we add Honza's patch.  Ok for 4.8?
>
> Peter
>
>
>         Backport from mainline
>         2013-09-06  Jan Hubicka  <jh@suse.cz>
>
>         * config/i386/i386.c (ix86_hard_regno_mode_ok): AVX modes are valid
>         only when AVX is enabled.
>
>         2013-09-05  Peter Bergner  <bergner@vnet.ibm.com>
>
>         PR target/58139
>         * reginfo.c (choose_hard_reg_mode): Scan through all mode classes
>         looking for widest mode.

OK for x86, with slight update, as suggested below.

> Index: gcc/config/i386/i386.c
> ===================================================================
> --- gcc/config/i386/i386.c      (revision 206582)
> +++ gcc/config/i386/i386.c      (working copy)
> @@ -33944,7 +33944,7 @@ ix86_hard_regno_mode_ok (int regno, enum
>          are available.  OImode move is available only when AVX is
>          enabled.  */
>        return ((TARGET_AVX && mode == OImode)
> -             || VALID_AVX256_REG_MODE (mode)
> +             || (TARGET_AVX && VALID_AVX256_REG_MODE (mode))

Please use VALID_AVX256_REG_OR_IO_MODE define:

      /* OImode move and AVX modes are available only when AVX is enabled.  */
      return ((TARGET_AVX
           && VALID_AVX256_REG_OR_OI_MODE (mode))
...

Thanks,
Uros.



More information about the Gcc-patches mailing list