From 2e6315ef8c8a0f607fe86c7b7cf7d89549caa1e9 Mon Sep 17 00:00:00 2001 From: William Schmidt Date: Thu, 23 Mar 2017 13:13:44 +0000 Subject: [PATCH] re PR tree-optimization/79908 (ICE in gimplify_expr (gimplify.c:12155) gimplification failed) [gcc] 2017-03-23 Bill Schmidt Richard Biener PR tree-optimization/79908 PR tree-optimization/80136 * tree-stdarg.c (expand_ifn_va_arg_1): For a VA_ARG whose LHS has been cast away, gimplify_and_add suffices. [gcc/testsuite] 2017-03-23 Bill Schmidt Richard Biener PR tree-optimization/79908 PR tree-optimization/80136 * gcc.dg/torture/pr79908.c: New file. From-SVN: r246418 --- gcc/ChangeLog | 8 ++++++++ gcc/testsuite/ChangeLog | 9 ++++++++- gcc/testsuite/gcc.dg/torture/pr79908.c | 12 ++++++++++++ gcc/tree-stdarg.c | 2 +- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7135acce58a..091d78ab739 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-03-23 Bill Schmidt + Richard Biener + + PR tree-optimization/79908 + PR tree-optimization/80136 + * tree-stdarg.c (expand_ifn_va_arg_1): For a VA_ARG whose LHS has + been cast away, gimplify_and_add suffices. + 2017-03-23 Markus Trippelsdorf * tree-vrp.c (identify_jump_threads): Delete avail_exprs. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 555671f7d6a..257c5ce832a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,13 @@ +2017-03-23 Bill Schmidt + Richard Biener + + PR tree-optimization/79908 + PR tree-optimization/80136 + * gcc.dg/torture/pr79908.c: New file. + 2017-03-22 Nicolas Koenig - PR fortran/39239 + PR fortran/39239 * gfortran.dg/equiv_constraint_bind_c.f90: New test. 2017-03-22 Jakub Jelinek diff --git a/gcc/testsuite/gcc.dg/torture/pr79908.c b/gcc/testsuite/gcc.dg/torture/pr79908.c index e69de29bb2d..e2d6920a4cd 100644 --- a/gcc/testsuite/gcc.dg/torture/pr79908.c +++ b/gcc/testsuite/gcc.dg/torture/pr79908.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ + +/* Used to fail in the stdarg pass before fix for PR79908. */ + +typedef __builtin_va_list __gnuc_va_list; +typedef __gnuc_va_list va_list; + +void testva (int n, ...) +{ + va_list ap; + _Complex int i = __builtin_va_arg (ap, _Complex int); +} diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c index 8972822f5b7..923b315e79e 100644 --- a/gcc/tree-stdarg.c +++ b/gcc/tree-stdarg.c @@ -1058,7 +1058,7 @@ expand_ifn_va_arg_1 (function *fun) gimplify_assign (lhs, expr, &pre); } else - gimplify_expr (&expr, &pre, &post, is_gimple_lvalue, fb_lvalue); + gimplify_and_add (expr, &pre); input_location = saved_location; pop_gimplify_context (NULL); -- 2.30.2