Bug#202017: gcc-3.3: Unnecessary branching with INET/INET6 port setting
<herbert@gondor.apana.org.au> writes:
> As you can see, the branch due to the family is unnecessary. This bug
> exists in gcc272, gcc 2.95 and gcc 3.2
It is unlikely that this bug will ever get fixed, as gcc won't be able
to determine that the two __asm__ blocks really have the same effect.
So if you want to avoid this problem, you need to rewrite your code,
e.g. as
uint16_t p = htons(port);
if (family == AF_INET6)
u->in6.sin6_port = p;
else
u->in.sin_port = p;
Regards,
Martin
Reply to: