News for hackers. Stuff that matters.
Re:Ask HN: Why does Linux Kernel use goto statements? by throwaway29303 on Wednesday December 08, 2021 @12:37AM (#29481589)

  (I _like_ using goto's every once in a while: it can often mess up the gcc optimizer just enough to get better code out of it. In this case, as the signal test is not usually true, the goto forces gcc to use better jump placement and avoid the branch in the usual case).

  As to whether it reall matters: no, it doesn't. The largest reason I do this once in a while is that I look at the assembly gcc produces for quite other reasons, and use a goto to make it slightly easier to read (not the C code, the assembly ;-)
http://lkml.iu.edu/hypermail/linux/kernel/9507/0475.html

Please note that this is from 1995. Compiler behaviour might have changed.

Other interesting posts:

https://marc.info/?l=linux-kernel&m=104240115806388&w=2

https://marc.info/?l=linux-kernel&m=104240357108566&w=2

https://marc.info/?l=linux-kernel&m=104240441009296&w=2

Re:Ask HN: Why does Linux Kernel use goto statements? by ThrowawayR2 on Wednesday December 08, 2021 @01:25AM (#29481824)
There's a one-page version of the latter conversation: https://koblents.com/Ches/Links/20-Using-Goto-in-Linux-Kerne...