This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH PR83789] Fix for Altivec builtin failure
- From: Kaushik Phatak <Kaushik dot Phatak at kpit dot com>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Cc: "wschmidt at gcc dot gnu dot org" <wschmidt at gcc dot gnu dot org>
- Date: Thu, 1 Feb 2018 12:26:41 +0000
- Subject: [PATCH PR83789] Fix for Altivec builtin failure
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Kaushik dot Phatak at kpit dot com;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi,
Please find below a patch to fix PR83789.
The altivec builtin '__builtin_altivec_lvx' fails for the 32-bit powerpc-linux target.
This is observed in gcc-7 onwards and does not affect powerpc64-linux target.
This is regression tested for powerpc-linux.
Please let me know if this patch is OK.
Regards,
Kaushik M Phatak
2018-02-01 Kaushik Phatak <kaushik.phatak@kpit.com>
PR target/83789
* config/rs6000/rs6000.c (altivec_expand_builtin): Provide
support for 32-bit target for altivec builtin.
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 256400)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -15799,8 +15799,10 @@
exp, target, false);
case ALTIVEC_BUILTIN_LVX:
case ALTIVEC_BUILTIN_LVX_V4SI:
- return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx_v4si_2op,
- exp, target, false);
+ return altivec_expand_lv_builtin (((TARGET_64BIT)
+ ? CODE_FOR_altivec_lvx_v4si_2op
+ : CODE_FOR_altivec_lvx_v4si_internal),
+ exp, target, false);
case ALTIVEC_BUILTIN_LVX_V8HI:
return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx_v8hi_2op,
exp, target, false);