Skip to content

Compilation warnings with GCC 8.3 #1627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fwyzard opened this issue May 1, 2020 · 5 comments
Closed

Compilation warnings with GCC 8.3 #1627

fwyzard opened this issue May 1, 2020 · 5 comments

Comments

@fwyzard
Copy link
Contributor

fwyzard commented May 1, 2020

Building the current HEAD with GCC 8.3 on CentOS 8 results in many compilation warnings.

The full build log is attached: build.txt .

The warnings relevant for the sycl package are already mentioned in #1572.

The warnings relevant for the libdevice package are:

In file included from /data/user/fwyzard/sycl/llvm/libdevice/fallback-cassert.cpp:9:
/data/user/fwyzard/sycl/llvm/libdevice/wrapper.h:16:1: warning: attribute declaration must precede definition [-Wignored-attributes]
DEVICE_EXTERNAL size_t __spirv_GlobalInvocationId_x();
^
/data/user/fwyzard/sycl/llvm/libdevice/device.h:28:54: note: expanded from macro 'DEVICE_EXTERNAL'                                                                                                                                                                              
#define DEVICE_EXTERNAL SYCL_EXTERNAL __attribute__((weak))
                                                    ^
/data/user/fwyzard/sycl/llvm/libdevice/spirv_vars.hpp:32:29: note: previous definition is here                                                                                                                                                                                  
SYCL_EXTERNAL inline size_t __spirv_GlobalInvocationId_x() {
                           ^

(repeated for lines 17, 18, 20, 21, 22, and repeater for other other source files)

The warnings for libclc are

/data/user/fwyzard/sycl/llvm/libclc/generic/libspirv/math/clc_ldexp.cl:40:40: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
               int mr = e == 0 | v == 0 | v == 0xff ? 0 : m;
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/data/user/fwyzard/sycl/llvm/libclc/generic/libspirv/math/clc_ldexp.cl:40:40: note: place parentheses around the '|' expression to silence this warning                                                                                                                         
               int mr = e == 0 | v == 0 | v == 0xff ? 0 : m;
                                                    ^
                        (                          )                                                                                                                                                                                                                           
/data/user/fwyzard/sycl/llvm/libclc/generic/libspirv/math/clc_ldexp.cl:40:40: note: place parentheses around the '?:' expression to evaluate it first                                                                                                                           
               int mr = e == 0 | v == 0 | v == 0xff ? 0 : m;
                                                    ^
                                          (                )                                                                                                                                                                                                                   

(repeated other 17 times for clc_ldexp.cl, clc_pow.cl, expm1.cl, log_base.h and sincos_helpers.cl), and

warning: Linking two modules of different data layouts: 'CMakeFiles/builtins.link.libspirv-nvptx64--nvidiacl.dir/ptx-nvidiacl/libspirv/atomic/loadstore_helpers.bc' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:
128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5' whereas 'llvm-link' is 'e-i64:64-i128:128-v16:16-v32:32-n16:32:64'

warning: Linking two modules of different data layouts: 'CMakeFiles/builtins.link.libspirv-nvptx64--nvidiacl.dir/ptx-nvidiacl/libspirv/cl_khr_int64_extended_atomics/minmax_helpers.bc' is 'e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:3
2-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5' whereas 'llvm-link' is 'e-i64:64-i128:128-v16:16-v32:32-n16:32:64'
@bader
Copy link
Contributor

bader commented May 1, 2020

Most of sycl library warnings were already reported in #1572.
Could you update the existing issue instead, please?
libdevice library warnings are supposed to be addressed by #1398.
libclc is not built by GCC. It's built by clang.

I suggest leave libclc issue here and move other issues to 1572.
Are you okay with that?

@fwyzard
Copy link
Contributor Author

fwyzard commented May 1, 2020

Thanks for the pointer to #1572 for the sycl warnings, I will update the description of the issue to point there.

I don't see the libdevice warnings mentioned in #1398 .
Should I comment there ?

@bader
Copy link
Contributor

bader commented May 2, 2020

I don't see the libdevice warnings mentioned in #1398 .
Should I comment there ?

The main goal of #1398 is to do the refactoring improving UX and code maintainability. According to my understanding, warnings should be addressed as a side effect of these changes.

Anyway, I see that you created a separate PR (#1630) to address the issue with warnings, so I guess this questions is not relevant anymore.

Thanks a lot for doing this work!

@AlexeySachkov
Copy link
Contributor

@fwyzard, seems like you have submitted a PR to fix warnings, can we close this issue then?

@AlexeySachkov
Copy link
Contributor

I assume that this issue is fixed and therefore closing it. @fwyzard, please speak up if there are still some warnings observable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants