This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix __builtin_va_start expansion after MEM_REF changes on ppc*/spu/s390* (PR target/46234)


Hi!

While build_va_arg_indirect_ref is fine in va_arg gimplification, in
*_va_start expansion it is wrong, because the expander now no longer
handles INDIRECT_REF.  Fixed by calling build_simple_mem_ref instead,
which is what other targets are now doing.
Pat has bootstrapped/regtested this on PowerPC and Andreas tested it
on s390*.  Ok for trunk?

2010-11-04  Jakub Jelinek  <jakub@redhat.com>

	PR target/46234
	* config/rs6000/rs6000.c (rs6000_va_start): Use build_simple_mem_ref
	instead of build_va_arg_indirect_ref.
	* config/spu/spu.c (spu_va_start): Likewise.
	* config/s390/s390.c (s390_va_start): Likewise.

--- gcc/config/rs6000/rs6000.c.jj	2010-11-03 16:58:31.000000000 +0100
+++ gcc/config/rs6000/rs6000.c	2010-11-03 18:15:24.000000000 +0100
@@ -9252,7 +9252,7 @@ rs6000_va_start (tree valist, rtx nextar
   f_ovf = DECL_CHAIN (f_res);
   f_sav = DECL_CHAIN (f_ovf);
 
-  valist = build_va_arg_indirect_ref (valist);
+  valist = build_simple_mem_ref (valist);
   gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
   fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), unshare_expr (valist),
 		f_fpr, NULL_TREE);
--- gcc/config/spu/spu.c.jj	2010-11-01 09:06:42.000000000 +0100
+++ gcc/config/spu/spu.c	2010-11-03 18:16:08.000000000 +0100
@@ -4154,7 +4154,7 @@ spu_va_start (tree valist, rtx nextarg)
   f_args = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
   f_skip = DECL_CHAIN (f_args);
 
-  valist = build_va_arg_indirect_ref (valist);
+  valist = build_simple_mem_ref (valist);
   args =
     build3 (COMPONENT_REF, TREE_TYPE (f_args), valist, f_args, NULL_TREE);
   skip =
--- gcc/config/s390/s390.c.jj	2010-11-01 09:06:42.000000000 +0100
+++ gcc/config/s390/s390.c	2010-11-03 18:15:47.000000000 +0100
@@ -8719,7 +8719,7 @@ s390_va_start (tree valist, rtx nextarg 
   f_ovf = DECL_CHAIN (f_fpr);
   f_sav = DECL_CHAIN (f_ovf);
 
-  valist = build_va_arg_indirect_ref (valist);
+  valist = build_simple_mem_ref (valist);
   gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
   fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE);
   ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE);

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]