Fix altivec-cell-2.C test regression (PR c++/83778)

Message ID 20180112202349.GJ2063@tucnak
State New
Headers show
Series
  • Fix altivec-cell-2.C test regression (PR c++/83778)
Related show

Commit Message

Jakub Jelinek Jan. 12, 2018, 8:23 p.m.
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.


	Jakub

Comments

Segher Boessenkool Jan. 12, 2018, 9:28 p.m. | #1
On Fri, Jan 12, 2018 at 09:23:49PM +0100, Jakub Jelinek wrote:
> 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?

Looks good to me.  Okay for trunk.  Thanks!


> 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.

Patch

--- 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;