Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable implicit fallthrough warning #43397

Merged
merged 14 commits into from
Oct 21, 2020
Prev Previous commit
Next Next commit
Reflect PR feedback
  • Loading branch information
janvorli committed Oct 14, 2020
commit 2ed53abcfd34c6ef3ca9a6467ccad9b8a5f33d75
2 changes: 1 addition & 1 deletion src/coreclr/src/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6278,7 +6278,7 @@ void Lowering::ContainCheckNode(GenTree* node)
break;
case GT_STOREIND:
ContainCheckStoreIndir(node->AsIndir());
__fallthrough; // TODO: is this actually a bug?
break;
case GT_IND:
ContainCheckIndir(node->AsIndir());
break;
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/src/jit/lowerxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5594,6 +5594,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node)
}
}
}
unreached();
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use unreached(); break; in such cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandreenko in the CI run, 15 coreclr tests have failed due to this added unreachable. So it seems it should be just a break here. I guess the fall through that was here before was benign, as the switch in the case below would end up in the default and nothing wrong would happen.

}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/jit/optcse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3633,7 +3633,7 @@ bool Compiler::optIsCSEcandidate(GenTree* tree)
{
return false;
}
__fallthrough;
return true;

case GT_EQ:
case GT_NE:
Expand Down