[gcc r17-3326] middle-end: Unset stdarg when lowering assumptions

Josef Melcr via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:5e96cff93ecaa8bc4c8309241853f74ba638aaf8

commit r17-3326-g5e96cff93ecaa8bc4c8309241853f74ba638aaf8
Author: Josef Melcr <[email protected]>
Date:   Tue Aug 11 13:19:25 2026 +0200

    middle-end: Unset stdarg when lowering assumptions
    
    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.
    
    gcc/ChangeLog:
    
            * gimple-low.cc (lower_assumption): Unset stdarg after
            determining the body function's arguments.
    
    Signed-off-by: Josef Melcr <[email protected]>

Diff:
---
 gcc/gimple-low.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/gimple-low.cc b/gcc/gimple-low.cc
index 5915d7234e0b..ed7524298544 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);
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.