This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] fold const fix 6
- From: law at redhat dot com
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, dnovillo at redhat dot com
- Date: Mon, 05 Jan 2004 22:45:08 -0700
- Subject: Re: [tree-ssa] fold const fix 6
- Reply-to: law at redhat dot com
In message <20031222102535.GI17542@kam.mff.cuni.cz>, Jan Hubicka writes:
>unfortunately, it has turned out that one workaround is still needed in order
>to get statements into folded form.
>switch_expr has semantic dependent on the type of operand. So swtich_expr
>(enum_type) expect that only values allowed by enum are possible. But for C
>all values are always possible, so we represent it using case switch_expr
>((int)enym_type)). There is gly exception in GIMPLE grammar allowing
>SWITCH_EXPR to have nested NOP_EXPR in order to get proper warings on unhandl
>enum values for the testcase above. While this is all broken, I can't
>reorganize it right now (I have some patches to add switch_expr lowering pass
>on GIMPLE, so we decompose complex switch exprs into trivial tablejumps using
>profile instead of doing it on RTL expansion time with guessing, but this is
>still blocked by this particular thread of folding fixes, by Zdenek's block
>splitting code, by CFG RTL expansion code and by profile estimation patches).
>The patch bellow avoid fold_stmt from removing NOOP casts and breaking
>gcc.c-torture/execute/20030903-1.c when the fold() is run on swtich expr it i
>2003-12-22 Jan Hubicka <email@example.com>
> * tree-ssa-ccp.c (get_rhs): Skip NOP expr for SWITCH statement.
I believe this should no longer be necessary after Richard's changes from