According to tree.def, ASSERT_EXPR belongs to tcc_expression. When fold gets a tree node that is tcc_expressions, we do not get to the following switch statement.
switch (code) { case CONST_DECL: return fold (DECL_INITIAL (t)); case ASSERT_EXPR: So the ASSERT_EXPR case never triggers. -- Summary: ASSERT_EXPR handling in fold never triggers. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kazu at cs dot umass dot edu CC: dnovillo at redhat dot com,gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21047