X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=fold.cpp;h=7b13db60ed0c80f306d09e080f305363f7212d2e;hp=6d56d8af1d59e0cc95adb389d5337e6a12ee3ced;hb=1580c23556fea4089acf86462fdf28c281d93397;hpb=1a18ff529420930cb4116484991c2dabe3a70654 diff --git a/fold.cpp b/fold.cpp index 6d56d8a..7b13db6 100644 --- a/fold.cpp +++ b/fold.cpp @@ -508,7 +508,7 @@ static GMQCC_INLINE void sfloat_check(lex_ctx_t ctx, sfloat_state_t *state, cons compile_error(ctx, "arithmetic overflow in `%s' component", vec); if (state->exceptionflags & SFLOAT_UNDERFLOW) compile_error(ctx, "arithmetic underflow in `%s' component", vec); - return; + return; } if (state->exceptionflags & SFLOAT_DIVBYZERO) compile_error(ctx, "division by zero"); @@ -1392,8 +1392,8 @@ ast_expression *fold::op(const oper_info *info, ast_expression **opexprs) { return nullptr; switch(info->operands) { - case 3: if(!c) return nullptr; - case 2: if(!b) return nullptr; + case 3: if(!c) return nullptr; [[fallthrough]]; + case 2: if(!b) return nullptr; [[fallthrough]]; case 1: if(!a) { compile_error(ctx(), "internal error: fold_op no operands to fold\n"); @@ -1560,6 +1560,7 @@ ast_expression *fold::superfluous(ast_expression *left, ast_expression *right, i case INSTR_DIV_F: if (swapped) return nullptr; + [[fallthrough]]; case INSTR_MUL_F: if (immvalue_float(load) == 1.0f) { ++opts_optimizationcount[OPTIM_PEEPHOLE]; @@ -1572,6 +1573,7 @@ ast_expression *fold::superfluous(ast_expression *left, ast_expression *right, i case INSTR_SUB_F: if (swapped) return nullptr; + [[fallthrough]]; case INSTR_ADD_F: if (immvalue_float(load) == 0.0f) { ++opts_optimizationcount[OPTIM_PEEPHOLE]; @@ -1591,6 +1593,7 @@ ast_expression *fold::superfluous(ast_expression *left, ast_expression *right, i case INSTR_SUB_V: if (swapped) return nullptr; + [[fallthrough]]; case INSTR_ADD_V: if (vec3_cmp(immvalue_vector(load), vec3_create(0, 0, 0))) { ++opts_optimizationcount[OPTIM_PEEPHOLE];