summaryrefslogtreecommitdiff
path: root/gcc/tree-stdarg.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-11 19:57:23 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-11 19:57:23 +0000
commit4b4d1c3b10f0666c1b6775e7ad3775969f35601b (patch)
tree91a92cdc2750682c8d6499479f8bc9594df60236 /gcc/tree-stdarg.c
parent529fcc2a2fdcedb8c5d3b6dc455a1ee1de936fe7 (diff)
PR tree-optimization/51091
* tree-stdarg.c (execute_optimize_stdarg): Ignore TREE_CLOBBER_P rhs also in the va_list_simple_ptr case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181299 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-stdarg.c')
-rw-r--r--gcc/tree-stdarg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index ef898ee5bbdf..9b7a126b1ef4 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -1,5 +1,5 @@
/* Pass computing data for optimizing stdarg functions.
- Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010
+ Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>
@@ -847,8 +847,12 @@ execute_optimize_stdarg (void)
if (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
== GIMPLE_SINGLE_RHS)
{
+ /* Check for ap ={v} {}. */
+ if (TREE_CLOBBER_P (rhs))
+ continue;
+
/* Check for tem = ap. */
- if (va_list_ptr_read (&si, rhs, lhs))
+ else if (va_list_ptr_read (&si, rhs, lhs))
continue;
/* Check for the last insn in:
@@ -875,6 +879,7 @@ execute_optimize_stdarg (void)
/* Check for ap ={v} {}. */
if (TREE_CLOBBER_P (rhs))
continue;
+
/* Check for ap[0].field = temp. */
else if (va_list_counter_struct_op (&si, lhs, rhs, true))
continue;