re PR target/38123 (error: incorrect sharing of tree nodes ap->fp_offset = D.2748;)

PR target/38123
	* config/i386/i386.c (ix86_gimplify_va_arg): Don't share valist between
	gpr and other COMPONENT_REFs.

	* gcc.c-torture/compile/pr38123.c: New test.

From-SVN: r141889
This commit is contained in:
Jakub Jelinek 2008-11-15 17:40:24 +01:00
parent 6389463779
commit 6d8f280f7a
4 changed files with 27 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2008-11-15 Jakub Jelinek <jakub@redhat.com>
PR target/38123
* config/i386/i386.c (ix86_gimplify_va_arg): Don't share valist between
gpr and other COMPONENT_REFs.
2008-11-15 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38051

View File

@ -6579,8 +6579,9 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
f_ovf = TREE_CHAIN (f_fpr);
f_sav = TREE_CHAIN (f_ovf);
gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr),
build_va_arg_indirect_ref (valist), f_gpr, NULL_TREE);
valist = build_va_arg_indirect_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);
sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE);

View File

@ -1,5 +1,10 @@
2008-11-15 Jakub Jelinek <jakub@redhat.com>
PR target/38123
* gcc.c-torture/compile/pr38123.c: New test.
2008-11-15 Richard Guenther <rguenther@suse.de>
Jakub Jelinek <jakub@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/38051
* gcc.c-torture/execute/pr38051.c: New testcase.

View File

@ -0,0 +1,13 @@
/* PR target/38123 */
#include <stdarg.h>
struct S { int i; double d; };
struct S
test (char *x, va_list ap)
{
struct S s;
s = va_arg (ap, struct S);
return s;
}