This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/78879] -fprofile-generate causes undefined reference to `____ilog2_NaN'
- From: "coolypf at qq dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Dec 2016 12:57:24 +0000
- Subject: [Bug middle-end/78879] -fprofile-generate causes undefined reference to `____ilog2_NaN'
- Auto-submitted: auto-generated
- References: <bug-78879-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78879
--- Comment #5 from Yuan Pengfei <coolypf at qq dot com> ---
(In reply to Markus Trippelsdorf from comment #3)
> (In reply to Yuan Pengfei from comment #2)
> > (In reply to Markus Trippelsdorf from comment #1)
> > > See discussion in PR72785.
> >
> > I am using GCC 6.2.1. Is it the same problem?
>
> Yes, I think so. The compiler is under no obligation to optimize the
> ____ilog2_NaN call away. It looks like a kernel bug.
I don't think so. In this case, the value of sector_size is constant (256, 512,
1024, 2048, 4096) and the ____ilog2_NaN call can be optimized away.
It is after enabling the -fprofile-generate option when the compiler thinks the
____ilog2_NaN call can not be optimized away.
Reference source code:
http://lxr.free-electrons.com/source/drivers/scsi/sd.c?v=3.10#L2163