[PATCH] middle-end: Unset stdarg when lowering assumptions

Josef Melcr <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>
Hi,
when building the body function of an assumption, its decl temporarily
has variable arguments (gimple-low.cc:293), as the count and types of
arguments are not yet determined.  However, after constructing
the arguments list, the function's struct function still has stdarg set.
This patch fixes that.  The decl's arguments list is already being
constructed with a void_type_node terminator, so all is good on that front.

Bootstrapped and regtested on aarch64-unknown-linux-gnu.  OK for master?

Best regards,
Josef

gcc/ChangeLog:

	* gimple-low.cc (lower_assumption): Unset stdarg after
	determining the body function's arguments.

Signed-off-by: Josef Melcr <[email protected]>
---
 gcc/gimple-low.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/gimple-low.cc b/gcc/gimple-low.cc
index 5915d7234e0..ed752429854 100644
--- a/gcc/gimple-low.cc
+++ b/gcc/gimple-low.cc
@@ -673,6 +673,8 @@ lower_assumption (gimple_stmt_iterator *gsi, struct lower_data *data)
     }
   DECL_ARGUMENTS (lad.id.dst_fn) = parms;
   TREE_TYPE (lad.id.dst_fn) = build_function_type (boolean_type_node, parmt);
+  /* The body function no longer has var. args, unset stdarg.  */
+  DECL_STRUCT_FUNCTION (lad.id.dst_fn)->stdarg = 0;
 
   cgraph_node::add_new_function (lad.id.dst_fn, false);
 
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.