Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 547672 (PR65873) - [5.1] sys-devel/gcc: Failure to inline always_inline memcpy (x11-drivers/xf86-video-intel)
Summary: [5.1] sys-devel/gcc: Failure to inline always_inline memcpy (x11-drivers/xf86...
Status: RESOLVED FIXED
Alias: PR65873
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://gcc.gnu.org/PR65873
Whiteboard:
Keywords:
: 551328 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-04-25 08:54 UTC by Robert Sebastian Gerus
Modified: 2016-05-11 06:00 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
PR65873 (PR65873.patch,6.71 KB, patch)
2015-06-14 15:56 UTC, Jory A. Pratt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Sebastian Gerus 2015-04-25 08:54:38 UTC
There's a known upstream bug in gcc-5.1 causing compilation failures when an always_inline function uses memcpy.


Reproducible: Always

Steps to Reproduce:
1. emerge -v1 xf86-video-intel
Actual Results:  
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna -I../.. -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototy
pes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wcast-qual -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implic
it -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to
-int-cast -fno-strict-aliasing -I/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src -I/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/render_program -fvisibil
ity=hidden -I/usr/include/xorg -I/usr/include/X11/dri -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/libdrm -Wno-cast-qual -Wno-redundant-decls -Wno-maybe-uninitialized -Os -mtune=generic -pipe -c /var/tmp/portage/x11-drivers
/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna_display_fake.c  -fPIC -DPIC -o .libs/sna_display_fake.o
In file included from /usr/include/features.h:366:0,
                 from /usr/include/stdint.h:25,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/stdint.h:9,
                 from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna.h:40,
                 from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:32:
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c: In function ‘memcpy_from_tiled_x__swizzle_9_11’:
/usr/include/bits/string3.h:48:1: error: inlining failed in call to always_inline ‘memcpy’: optimization level attribute mismatch
 __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
 ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:720:4: error: called from here
    memcpy(dst_row, (const char *)src + offset, length * cpp);
    ^
In file included from /usr/include/features.h:366:0,
                 from /usr/include/stdint.h:25,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/stdint.h:9,
                 from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna.h:40,
                 from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:32:
/usr/include/bits/string3.h:48:1: error: inlining failed in call to always_inline ‘memcpy’: optimization level attribute mismatch
 __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
 ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:732:4: error: called from here
    memcpy(dst_row, (const char *)src + offset, 64);
    ^
In file included from /usr/include/features.h:366:0,
                 from /usr/include/stdint.h:25,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/stdint.h:9,
                 from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna.h:40,
                 from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:32:
/usr/include/bits/string3.h:48:1: error: inlining failed in call to always_inline ‘memcpy’: optimization level attribute mismatch
 __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
 ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:743:4: error: called from here
    memcpy(dst_row, (const char *)src + offset, x);
    ^
Makefile:638: recipe for target 'blt.lo' failed
make[4]: *** [blt.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna_accel.c: In function ‘sna_poly_zero_line_blt’:
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna_accel.c:9128:11: warning: variable ‘intersects’ set but not used [-Wunused-but-set-variable]
      bool intersects;
           ^
/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna_accel.c:9028:7: warning: variable ‘degenerate’ set but not used [-Wunused-but-set-variable]
  bool degenerate = true;
       ^
make[4]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build/src/sna'
Makefile:653: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build/src/sna'
Makefile:598: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build/src'
Makefile:468: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build'
Makefile:399: recipe for target 'all' failed
make: *** [all] Error 2


Expected Results:  
>>> x11-drivers/xf86-video-intel-2.99.917 merged.

Not actually expecting this issue to be fixed here, since it's a regression in gcc-5.1. Reporting it just for reference.
Comment 1 Robert Sebastian Gerus 2015-05-23 01:04:17 UTC
Workaround from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65873#c10 applies cleanly and seems to work - xf86-video-intel compiles and seems to work properly.
Comment 2 Ben Kohler gentoo-dev 2015-06-05 20:23:50 UTC
*** Bug 551328 has been marked as a duplicate of this bug. ***
Comment 3 Jory A. Pratt gentoo-dev 2015-06-14 15:56:41 UTC
Created attachment 405140 [details, diff]
PR65873

Make it easier for those who wish to use it now.
Comment 4 pereira.alex 2015-06-15 11:04:06 UTC
Well, for a quick solution, compile xf86-video-intel with -O0.

It compiled were well, although -O0 is not a proper solution. ( for anyone that doesnt want to recompile gcc )
Comment 5 Dale Lukas Peterson 2015-07-04 00:57:31 UTC
I'm not able to apply this patch, has anybody else had success with it?
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2015-07-18 05:26:32 UTC
This should be fixed with gcc-5.2.0.