https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127660
Bug ID: 127660
Summary: gimplifier throws away expressions with IEEE exception
side-effects
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
cases like the following with -ftrapping-math
int f(double a,double b){
a>b;
return 0;
}
fall to
/* This was only valid as a return value from the langhook, which
we handled. Make sure it doesn't escape from any other context. */
gcc_assert (ret != GS_UNHANDLED);
if (fallback == fb_none && *expr_p && !is_gimple_stmt (*expr_p))
{
/* We aren't looking for a value, and we don't have a valid
statement. If it doesn't have side-effects, throw it away.
We can also get here with code such as "*&&L;", where L is
a LABEL_DECL that is marked as FORCED_LABEL. */
if (TREE_CODE (*expr_p) == LABEL_DECL
|| !TREE_SIDE_EFFECTS (*expr_p))
*expr_p = NULL;