Bug 101662

Summary: compilation error with gcc 6.3.0
Product: Beignet Reporter: Kyrylo Shpytsya <kshpitsa>
Component: BeignetAssignee: Xiuli Pan <xiuli.pan>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: candrews
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Kyrylo Shpytsya 2017-06-30 10:55:29 UTC
/var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/backend/gen_insn_selection_optimize.cpp:462:28: error: call of overloaded ‘abs(unsigned int&)’ is ambiguous
                 s0 = abs(s0);
                            ^
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/cstdlib:75:0,
                 from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/./sys/platform.hpp:24,
                 from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/./sys/vector.hpp:28,
                 from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/./ir/register.hpp:27,
                 from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/./backend/gen_insn_selection.hpp:28,
                 from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/backend/gen_insn_selection_optimize.cpp:2:
/usr/include/stdlib.h:735:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/./sys/platform.hpp:24:0,
                 from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/./sys/vector.hpp:28,
                 from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/./ir/register.hpp:27,
                 from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/./backend/gen_insn_selection.hpp:28,
                 from /var/tmp/portage/dev-libs/intel-beignet-9999/work/intel-beignet-9999/backend/src/backend/gen_insn_selection_optimize.cpp:2:
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.0/include/g++-v6/cstdlib:172:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69751
Comment 1 Xiuli Pan 2017-07-04 16:53:17 UTC
Hi Kyrylo,

Are you using the master branch?
If so, it must be some new added code ignored the GCC6 porting and I will fix them, thanks

Xiuli
Comment 2 Kyrylo Shpytsya 2017-07-04 19:42:50 UTC
Yes, that was "master" branch.
Comment 3 Xiuli Pan 2017-07-11 02:08:43 UTC
You can try the patch here, just refer from:
https://gcc.gnu.org/gcc-6/porting_to.html
Patch:
https://patchwork.freedesktop.org/patch/166099/
Comment 4 arnold.putz 2017-07-11 12:00:48 UTC
tested and works with g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
Comment 5 Kyrylo Shpytsya 2017-07-11 12:27:46 UTC
Works with the supplied patch on my Gentoo as well.
Comment 6 GitLab Migration User 2018-10-12 21:25:28 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/beignet/beignet/issues/48.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.