[patch] fold-const.c: Don't handle ASSERT_EXPR.

Andrew Pinski pinskia@physics.uc.edu
Mon Apr 25 17:33:00 GMT 2005


On Apr 25, 2005, at 1:18 PM, Kazu Hirata wrote:

> Hi Diego,
>
>>> 	PR tree-optimization/21047
>>> 	* fold-const.c (fold): Don't handle ASSERT_EXPR.
>>>
>> Fine with me.  This is a remnant from when I was adding
>> ASSERT_EXPRs before going into SSA.  We now only add them when
>> doing VRP and then the propagated ranges end up in the SSA names,
>> so fold should never see ASSERT_EXPRs.
>>
>> In fact, aborting on an ASSERT_EXPR wouldn't be a bad idea.
>
> Thanks.  Then I am going to do this in one shot.  I am going to post a
> patch to remove the handling of ASSERT_EXPR from fold *and* add to
> fold_binary
>
>   case ASSERT_EXPR:
>     /* An ASSERT_EXPR should never be passed to fold_binary.  */
>     gcc_unreachable ();

Make sure that this is at the end of the switch, overwise if somehow
we get an ASSERT_EXPR inside fold_binary and we have --disable-checking,
we will get funny behavior.

-- Pinski



More information about the Gcc-patches mailing list