This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [4.7 regression?] HImode 'smax' RTL generation
- From: Frederic Riss <frederic dot riss at gmail dot com>
- To: gcc <gcc at gcc dot gnu dot org>
- Date: Wed, 14 Mar 2012 11:39:08 +0100
- Subject: Re: [4.7 regression?] HImode 'smax' RTL generation
- References: <1331674571.2067.12.camel@funkybook>
On 13 March 2012 22:36, Frédéric RISS <frederic.riss@gmail.com> wrote:
> In 4.7, the COND_EXPR has become a GIMPLE_TERNARY_RHS rhs_class, meaning
> that it won't use the expand_assigment path in expand_gimple_stmt_1, but
> will use straight expression expansion which will generate control flow
> RTL for the COND_EXPR.
>
> Should this be considered a code generation regression, or should the
> MAX_EXPR trees be generated at some other point in the middle-end ?
This one-liner fixes this code generation regression on my simple testcase:
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index bde15f6..6fd09f5 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -3776,6 +3803,7 @@ expand_gimple_basic_block (basic_block bb)
{
basic_block new_bb;
+ fold_stmt_inplace (&gsi);
stmt = gsi_stmt (gsi);
/* If this statement is a non-debug one, and we generate debug
Doing that at expansion time looks like papering over some other issue though.
Fred