[Bug tree-optimization/94779] Bad optimization of simple switch
gabravier at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Apr 27 06:51:56 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94779
--- Comment #8 from Gabriel Ravier <gabravier at gmail dot com> ---
Also, this code :
int f1(unsigned x)
{
if (x >= 3)
__builtin_unreachable();
switch (x)
{
case 0:
return 1;
case 1:
return 2;
case 2:
return 3;
}
}
doesn't optimize as well as
int f1(unsigned x)
{
switch (x)
{
case 0:
return 1;
case 1:
return 2;
case 2:
return 3;
}
}
, despite being both equivalent and providing more information to the early
stages of optimization. Should I open a seperate bug report for this or is it
close enough to this that it would be considered a duplicate ?
More information about the Gcc-bugs
mailing list