Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Török Edwin" <edwintorok@gmail.com>
To: James.Bottomley@HansenPartnership.com
Cc: linux-scsi@vger.kernel.org, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: 2.6.28-rc6-tip fails to build with gcc 4.4.0
Date: Mon, 24 Nov 2008 16:28:13 +0200	[thread overview]
Message-ID: <492AB9FD.5010602@gmail.com> (raw)

Hi,

Using gcc version 4.4.0 20081120 (experimental) [trunk revision 142055]
I can't build latest tip/master (commit
b27fef5b222564b6e7ae71f7110c233b2fb45a38)

drivers/built-in.o: In function `sd_revalidate_disk':
sd.c:(.text+0x8bc76): undefined reference to `____ilog2_NaN'
make: *** [.tmp_vmlinux1] Error 1

Apparently gcc determines that sector_size can have an invalid constant
value as ilog2's parameter in sd_read_capacity.

I tried to narrow down, but all I found so far is that gcc 4.4.0 now
says that __builtin_constant_p() is true even in these cases:

a = .. constant value ...
if (cond) {
     a = ... constant value ...
}
__builtin_constant_p(a) ? ....

a = .. constant value ...
if (cond) {
     a = ... constant value ...
} else {
   a = ... another constant value ...
}
__builtin_constant_p(a) ? ....

I guess it clones the __builtin_constant_p for each branch, where a is
constant, gcc 4.3 doesn't seem to do that.

Did it find a real bug in sd.c, or is it a gcc bug?

Best regards,
--Edwin

             reply	other threads:[~2008-11-24 14:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-24 14:28 Török Edwin [this message]
2008-11-24 14:42 ` 2.6.28-rc6-tip fails to build with gcc 4.4.0 Markus Trippelsdorf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=492AB9FD.5010602@gmail.com \
    --to=edwintorok@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox