This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix altivec-cell-2.C test regression (PR c++/83778)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: gcc-patches at gcc dot gnu dot org, David Malcolm <dmalcolm at redhat dot com>
- Date: Fri, 12 Jan 2018 21:23:49 +0100
- Subject: [PATCH] Fix altivec-cell-2.C test regression (PR c++/83778)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
After the addition of location wrappers the
targetm.resolve_overloaded_builtin target hook is called with parameters
that may have those location wrappers in it. Seems generic code has been
changed to fold_for_warn fold it away when looking for something that should
be e.g. INTEGER_CST. Fixed thusly, bootstrapped/regtested on
powerpc64le-linux, ok for trunk?
2018-01-12 Jakub Jelinek <jakub@redhat.com>
PR c++/83778
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Call
fold_for_warn before checking if arg2 is INTEGER_CST.
--- gcc/config/rs6000/rs6000-c.c.jj 2018-01-12 11:36:02.016223839 +0100
+++ gcc/config/rs6000/rs6000-c.c 2018-01-12 17:45:13.294256181 +0100
@@ -6496,6 +6496,8 @@ altivec_resolve_overloaded_builtin (loca
tree call = NULL_TREE;
int nunits = GET_MODE_NUNITS (mode);
+ arg2 = fold_for_warn (arg2);
+
/* If the second argument is an integer constant, if the value is in
the expected range, generate the built-in code if we can. We need
64-bit and direct move to extract the small integer vectors. */
@@ -6640,7 +6642,7 @@ altivec_resolve_overloaded_builtin (loca
arg0 = (*arglist)[0];
arg1 = (*arglist)[1];
arg1_type = TREE_TYPE (arg1);
- arg2 = (*arglist)[2];
+ arg2 = fold_for_warn ((*arglist)[2]);
if (TREE_CODE (arg1_type) != VECTOR_TYPE)
goto bad;
Jakub