mirror of git://gcc.gnu.org/git/gcc.git
Handle location in expand_ifn_va_arg_1
2015-06-09 Tom de Vries <tom@codesourcery.com> * tree-stdarg.c (expand_ifn_va_arg_1): Handle location. * gcc.target/i386/vararg-loc.c: New test. From-SVN: r224288
This commit is contained in:
parent
5af874fb65
commit
86b76c209b
|
|
@ -1,3 +1,7 @@
|
||||||
|
2015-06-09 Tom de Vries <tom@codesourcery.com>
|
||||||
|
|
||||||
|
* tree-stdarg.c (expand_ifn_va_arg_1): Handle location.
|
||||||
|
|
||||||
2015-06-09 Jason Merrill <jason@redhat.com>
|
2015-06-09 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
PR bootstrap/66448
|
PR bootstrap/66448
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
2015-06-09 Tom de Vries <tom@codesourcery.com>
|
||||||
|
|
||||||
|
* gcc.target/i386/vararg-loc.c: New test.
|
||||||
|
|
||||||
2015-06-09 Paolo Carlini <paolo.carlini@oracle.com>
|
2015-06-09 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
PR c++/65815
|
PR c++/65815
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-g -O0" } */
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
int /* 6. */
|
||||||
|
/* 7. */
|
||||||
|
f (int a, ...) /* 8. */
|
||||||
|
/* 9. */
|
||||||
|
{
|
||||||
|
|
||||||
|
int sum = a;
|
||||||
|
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start (ap, a);
|
||||||
|
|
||||||
|
sum += va_arg (ap, int); /* 18. */
|
||||||
|
|
||||||
|
sum += va_arg (ap, int); /* 20. */
|
||||||
|
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* { dg-final { scan-assembler-not "\\.loc 1 \[6789\] 0" } } */
|
||||||
|
/* { dg-final { scan-assembler-times "\\.loc 1 18 0" 1 } } */
|
||||||
|
/* { dg-final { scan-assembler-times "\\.loc 1 20 0" 1 } } */
|
||||||
|
|
@ -1031,6 +1031,7 @@ expand_ifn_va_arg_1 (function *fun)
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
basic_block bb;
|
basic_block bb;
|
||||||
gimple_stmt_iterator i;
|
gimple_stmt_iterator i;
|
||||||
|
location_t saved_location;
|
||||||
|
|
||||||
FOR_EACH_BB_FN (bb, fun)
|
FOR_EACH_BB_FN (bb, fun)
|
||||||
for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
|
for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
|
||||||
|
|
@ -1051,6 +1052,8 @@ expand_ifn_va_arg_1 (function *fun)
|
||||||
ap = build_fold_indirect_ref (ap);
|
ap = build_fold_indirect_ref (ap);
|
||||||
|
|
||||||
push_gimplify_context (false);
|
push_gimplify_context (false);
|
||||||
|
saved_location = input_location;
|
||||||
|
input_location = gimple_location (stmt);
|
||||||
|
|
||||||
/* Make it easier for the backends by protecting the valist argument
|
/* Make it easier for the backends by protecting the valist argument
|
||||||
from multiple evaluations. */
|
from multiple evaluations. */
|
||||||
|
|
@ -1081,6 +1084,7 @@ expand_ifn_va_arg_1 (function *fun)
|
||||||
else
|
else
|
||||||
gimplify_expr (&expr, &pre, &post, is_gimple_lvalue, fb_lvalue);
|
gimplify_expr (&expr, &pre, &post, is_gimple_lvalue, fb_lvalue);
|
||||||
|
|
||||||
|
input_location = saved_location;
|
||||||
pop_gimplify_context (NULL);
|
pop_gimplify_context (NULL);
|
||||||
|
|
||||||
gimple_seq_add_seq (&pre, post);
|
gimple_seq_add_seq (&pre, post);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue