public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* build error with GCC5.1.1
@ 2015-05-18  4:22 chunshan.zhu
  2015-05-18  7:15 ` Olivier Fourdan
  0 siblings, 1 reply; 2+ messages in thread
From: chunshan.zhu @ 2015-05-18  4:22 UTC (permalink / raw)
  To: ofourdan, intel-gfx

gcc5.1.1 generates an error at build time.

sna_accel.c: In function 'sna_poly_zero_line_blt':
sna_accel.c:9207:10: warning: variable 'intersects' set but not used 
[-Wunused-but-set-variable]
       bool intersects;
           ^
sna_accel.c:9107:6: warning: variable 'degenerate' set but not used 
[-Wunused-but-set-variable]
   bool degenerate = true;
       ^
   CC       sna_cpu.lo
In file included from /usr/include/string.h:635:0,
                  from /usr/include/xorg/os.h:53,
                  from /usr/include/xorg/misc.h:115,
                  from /usr/include/xorg/xf86str.h:37,
                  from sna.h:43,
                  from blt.c:32:
blt.c: In function 'memcpy_from_tiled_x__swizzle_9_10_11':
/usr/include/bits/string3.h:50:42: error: inlining failed in call to 
always_inline 'memcpy': optimization level attribute mismatch
  __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
                                           ^
blt.c:474:1314: error: called from here
In file included from /usr/include/string.h:635:0,
                  from /usr/include/xorg/os.h:53,
                  from /usr/include/xorg/misc.h:115,
                  from /usr/include/xorg/xf86str.h:37,
                  from sna.h:43,
                  from blt.c:32:
/usr/include/bits/string3.h:50:42: error: inlining failed in call to 
always_inline 'memcpy': optimization level attribute mismatch
  __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
                                           ^
blt.c:474:1605: error: called from here
In file included from /usr/include/string.h:635:0,
                  from /usr/include/xorg/os.h:53,
                  from /usr/include/xorg/misc.h:115,
                  from /usr/include/xorg/xf86str.h:37,
                  from sna.h:43,
                  from blt.c:32:
/usr/include/bits/string3.h:50:42: error: inlining failed in call to 
always_inline 'memcpy': optimization level attribute mismatch
  __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
                                           ^
blt.c:474:1865: error: called from here
Makefile:650: recipe for target 'blt.lo' failed

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: build error with GCC5.1.1
  2015-05-18  4:22 build error with GCC5.1.1 chunshan.zhu
@ 2015-05-18  7:15 ` Olivier Fourdan
  0 siblings, 0 replies; 2+ messages in thread
From: Olivier Fourdan @ 2015-05-18  7:15 UTC (permalink / raw)
  To: chunshan.zhu; +Cc: intel-gfx

Hey,

> gcc5.1.1 generates an error at build time.
> 
> sna_accel.c: In function 'sna_poly_zero_line_blt':
> sna_accel.c:9207:10: warning: variable 'intersects' set but not used
> [-Wunused-but-set-variable]
>        bool intersects;
>            ^
> sna_accel.c:9107:6: warning: variable 'degenerate' set but not used
> [-Wunused-but-set-variable]
>    bool degenerate = true;
>        ^

Well, those are "unused variable warnings" so not an error. Could be easily fixed though.

>    CC       sna_cpu.lo
> In file included from /usr/include/string.h:635:0,
>                   from /usr/include/xorg/os.h:53,
>                   from /usr/include/xorg/misc.h:115,
>                   from /usr/include/xorg/xf86str.h:37,
>                   from sna.h:43,
>                   from blt.c:32:
> blt.c: In function 'memcpy_from_tiled_x__swizzle_9_10_11':
> /usr/include/bits/string3.h:50:42: error: inlining failed in call to
> always_inline 'memcpy': optimization level attribute mismatch
>   __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,

Right, this is a known issue in gcc 5.1, see here:

http://gcc.gnu.org/PR65873

The (easy) workaround is to avoid the "-Ofast" optimization.

E.g. something like that in src/sna/compiler.h:

--- a/src/sna/compiler.h
+++ b/src/sna/compiler.h
@@ -63,7 +63,7 @@
 #define sse4_2 __attribute__((target("sse4.2,sse2,fpmath=sse")))
 #endif
 
-#if HAS_GCC(4, 6) && defined(__OPTIMIZE__)
+#if HAS_GCC(4, 6) && !HAS_GCC(5, 0) && defined(__OPTIMIZE__)
 #define fast __attribute__((optimize("Ofast")))
 #else
 #define fast

But I do not think this is something suitable for upstream as the bug lies in gcc, so it's just a workaround until the issue is fixed in gcc.

HTH

Cheers,
Olivier.

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-05-18  7:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18  4:22 build error with GCC5.1.1 chunshan.zhu
2015-05-18  7:15 ` Olivier Fourdan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox