This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] fold const fix 6


In message <20031222102535.GI17542@kam.mff.cuni.cz>, Jan Hubicka writes:
 >
 >Hi,
 >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
 >ed
 >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
 >s
 >containing.
 >
 >Honza
 >
 >2003-12-22  Jan Hubicka  <jh@suse.cz>
 >	* 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
earlier today.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]