public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/49642] New: constant part of a macro not optimized away as expected due to splitter
@ 2011-07-05 12:40 marcus at jet dot franken.de
  2011-07-05 12:41 ` [Bug c/49642] " marcus at jet dot franken.de
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: marcus at jet dot franken.de @ 2011-07-05 12:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49642

           Summary: constant part of a macro not optimized away as
                    expected due to splitter
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: marcus@jet.franken.de


my Linux kernel builds on gcc 4.6 pcc64 fail with:

ERROR: ".____ilog2_NaN" [drivers/infiniband/hw/ehca/ib_ehca.ko] undefined!

This comes from include/linux/log2.h which uses a large macro with
builtin_constant_p() to optimize constant ilog2 calls.

I have reduced it to the attached testcase.

$ gcc -m64 -O2 -fno-inline-functions-called-once -c ehca_mrmw.i ; objdump -dr
ehca_mrmw.o |grep NaN
                        1a8: R_PPC64_REL24      ____ilog2_NaN
                        1cc: R_PPC64_REL24      ____ilog2_NaN
$ 

It should not report NaN as that is in a if
(__builtin_constant_p(shca->hca_cap_mr_pgsize)) expression.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-01-18 21:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-05 12:40 [Bug c/49642] New: constant part of a macro not optimized away as expected due to splitter marcus at jet dot franken.de
2011-07-05 12:41 ` [Bug c/49642] " marcus at jet dot franken.de
2011-07-05 12:43 ` marcus at jet dot franken.de
2011-07-05 12:59 ` [Bug tree-optimization/49642] " rguenth at gcc dot gnu.org
2012-01-06 17:09 ` wschmidt at gcc dot gnu.org
2012-01-07  0:13 ` wschmidt at gcc dot gnu.org
2012-01-09 12:11 ` rguenth at gcc dot gnu.org
2012-01-09 21:59 ` wschmidt at gcc dot gnu.org
2012-01-11 16:52 ` wschmidt at gcc dot gnu.org
2012-01-11 22:38 ` wschmidt at gcc dot gnu.org
2012-01-18 20:07 ` wschmidt at gcc dot gnu.org
2012-01-18 20:37 ` wschmidt at gcc dot gnu.org
2012-01-18 23:06 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).