Skip to content

GenIsaIntrinsics dont build on GCC 7.2.1 #5

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
raunraun opened this issue Feb 7, 2018 · 5 comments
Closed

GenIsaIntrinsics dont build on GCC 7.2.1 #5

raunraun opened this issue Feb 7, 2018 · 5 comments

Comments

@raunraun
Copy link

raunraun commented Feb 7, 2018

It looks like warnings are treated as errors on the IGC build. Building with gcc 7.2.1 produces the following warning that causes the build to fail:

In file included from /home/raun/workspace/igc/IGC/common/Types.hpp:28:0,
                 from /home/raun/workspace/igc/IGC/common/Stats.hpp:38,
                 from /home/raun/workspace/igc/IGC/Compiler/CodeGenPublic.h:31,
                 from /home/raun/workspace/igc/IGC/GenISAIntrinsics/GenIntrinsics.cpp:28:
/home/raun/workspace/igc/IGC/../3d/common/iStdLib/types.h:91:32: error: ‘-pedantic’ is not an option that controls warnings [-Werror=pragmas]
 #pragma GCC diagnostic ignored "-pedantic" // warning: ISO C++ prohibits anonymous structs [-pedantic]
                                ^~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [GenISAIntrinsics/CMakeFiles/GenISAIntrinsics.dir/build.make:63: GenISAIntrinsics/CMakeFiles/GenISAIntrinsics.dir/GenIntrinsics.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:332: GenISAIntrinsics/CMakeFiles/GenISAIntrinsics.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
[raun@localhost build]$ Scanning dependencies of target GenISAIntrinsics
                 from /home/raun/workspace/igc/IGC/Compiler/CodeGenPublic.h:31,
                 from /home/raun/workspace/igc/IGC/GenISAIntrinsics/GenIntrinsics.cpp:28:
-bash: Scanning: command not found
/home/raun/workspace/igc/IGC/../3d/common/iStdLib/types.h:91:32: error: ‘-pedantic’ is not an option that controls warnings [-Werror=pragmas]
 #pragma GCC diagnostic ignored "-pedantic" // warning: ISO C++ prohibits anonymous structs [-pedantic]
[raun@localhost build]$ [  4%] Building CXX object GenISAIntrinsics/CMakeFiles/GenISAIntrinsics.dir/GenIntrinsics.cpp.o
-bash: [: missing `]'
[raun@localhost build]$ In file included from /home/raun/workspace/igc/IGC/common/Types.hpp:28:0,
-bash: In: command not found
[raun@localhost build]$                  from /home/raun/workspace/igc/IGC/common/Stats.hpp:38,
-bash: from: command not found
[raun@localhost build]$                  from /home/raun/workspace/igc/IGC/Compiler/CodeGenPublic.h:31,
-bash: from: command not found
[raun@localhost build]$                  from /home/raun/workspace/igc/IGC/GenISAIntrinsics/GenIntrinsics.cpp:28:
-bash: from: command not found
[raun@localhost build]$ /home/raun/workspace/igc/IGC/../3d/common/iStdLib/types.h:91:32: error: ‘-pedantic’ is not an option that controls warnings [-Werror=pragmas]
-bash: /home/raun/workspace/igc/IGC/../3d/common/iStdLib/types.h:91:32:: No such file or directory
[raun@localhost build]$  #pragma GCC diagnostic ignored "-pedantic" // warning: ISO C++ prohibits anonymous structs [-pedantic]
[raun@localhost build]$                                 ^~~~~~~~~~~
-bash: ^~~~~~~~~~~: command not found
[raun@localhost build]$ cc1plus: all warnings being treated as errors
-bash: cc1plus:: command not found


@pguo-igc
Copy link
Contributor

We have a patch to fix this error, after it got synced to github, this issue will be fix.

@pguo-igc
Copy link
Contributor

A local fix is to remove below line from iStdLib/types.h:
#pragma GCC diagnostic ignored "-pedantic"

@AnupamaChandrasekhar
Copy link
Contributor

I7376783521228493f2d894cf807e7124072e4314 should fix it. Can you check?

@raunraun
Copy link
Author

Nope, there's another hiding behind that one.

[ 45%] Building CXX object igc/IGC/visa/CMakeFiles/GenX_IR.dir/Common_ISA_framework.cpp.o
/home/raun/workspace/igc/visa/FlowGraph.cpp: In static member function ‘static const char* vISA::G4_Kernel::emit_asm(std::ostream&, bool, void*, uint32_t)::<lambda(int32_t, void*)>::_FUN(int32_t, void*)’:
/home/raun/workspace/igc/visa/FlowGraph.cpp:4200:70: error: ‘%s’ directive output may be truncated writing up to 63 bytes into a region of size 59 [-Werror=format-truncation=]
         auto labelerLambda = [](int32_t pc, void *data) -> const char*
                                                                      ^
In file included from /usr/include/stdio.h:862:0,
                 from /usr/include/c++/7/cstdio:42,
                 from /usr/include/c++/7/ext/string_conversions.h:43,
                 from /usr/include/c++/7/bits/basic_string.h:6347,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /home/raun/workspace/igc/visa/FlowGraph.h:30,
                 from /home/raun/workspace/igc/visa/FlowGraph.cpp:27:
/usr/include/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output 2 or more bytes (assuming 65) into a destination of size 60
        __bos (__s), __fmt, __va_arg_pack ());
                                            ^
/home/raun/workspace/igc/visa/FlowGraph.cpp: In member function ‘void vISA::G4_Kernel::emit_asm(std::ostream&, bool, void*, uint32_t)’:
/home/raun/workspace/igc/visa/FlowGraph.cpp:4026:6: error: ‘%s’ directive output may be truncated writing up to 63 bytes into a region of size 59 [-Werror=format-truncation=]
 void G4_Kernel::emit_asm(std::ostream& output, bool beforeRegAlloc, void * binary, uint32_t binarySize)
      ^~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from /usr/include/c++/7/cstdio:42,
                 from /usr/include/c++/7/ext/string_conversions.h:43,
                 from /usr/include/c++/7/bits/basic_string.h:6347,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /home/raun/workspace/igc/visa/FlowGraph.h:30,
                 from /home/raun/workspace/igc/visa/FlowGraph.cpp:27:
/usr/include/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output 2 or more bytes (assuming 65) into a destination of size 60
        __bos (__s), __fmt, __va_arg_pack ());
                                            ^
cc1plus: all warnings being treated as errors
make[2]: *** [igc/IGC/visa/CMakeFiles/GenX_IR.dir/build.make:279: igc/IGC/visa/CMakeFiles/GenX_IR.dir/FlowGraph.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

There's a lot of different compilers out there to appease. Do you mean to compile with warnings as errors for release builds? Perhaps a cmake variable to turn of -Werror would be appropriate?

@AnupamaChandrasekhar
Copy link
Contributor

Hi: This issue is fixed with the latest commit. We would like compile with warnings as errors, as the issues we have been finding so far have been genuine ones and we would like to fix those. Please let me know if the latest commit fixes your issue.

VPG-SWE-Github pushed a commit that referenced this issue Nov 2, 2020
VPG-SWE-Github pushed a commit that referenced this issue Nov 3, 2020
VPG-SWE-Github pushed a commit that referenced this issue Apr 20, 2021
The goal is to move us away from twiddling bits in descriptors every time we need to examine or modify send messages.
* All send descriptors (formerly G4_SendMsgDescriptor) are subclasses of G4_SendDesc
* The old raw descriptor is G4_SendDescRaw and there is a new G4_SendDescLdSt which is unused at the moment.
* Anywhere possible, we now use the generic methods of the superclass G4_SendDesc.
* In cases where the old code fiddles with bits directly and requires the raw descriptor, we add a type check and convert to G4_SendDescRaw (assert on fail / return false on pattern match if safe to do so (e.g. SendFusion::canFuse(..))).
* Do not let the old raw descriptor gunk pollute the generic interface of the parent.
* Push #5
VPG-SWE-Github pushed a commit that referenced this issue Apr 20, 2021
High-Level Load/Store G4IR support.
The goal is to move us away from twiddling bits in descriptors every time we need to examine or modify send messages.
* All send descriptors (formerly G4_SendMsgDescriptor) are subclasses of G4_SendDesc
* The old raw descriptor is G4_SendDescRaw and there is a new G4_SendDescLdSt which is unused at the moment.
* Anywhere possible, we now use the generic methods of the superclass G4_SendDesc.
* In cases where the old code fiddles with bits directly and requires the raw descriptor, we add a type check and convert to G4_SendDescRaw (assert on fail / return false on pattern match if safe to do so (e.g. SendFusion::canFuse(..))).
* Do not let the old raw descriptor gunk pollute the generic interface of the parent.
* Push #5
VPG-SWE-Github pushed a commit that referenced this issue May 31, 2023
Introduced a new flag "DisableFunctionCloning" for controling Function Cloning. This is currently disabled by default due to regressions.
FunctionCloningThreshold flag is now only used to select the threshold instead of enabling/disabling the feature.

FunctionCloningThreshold was disabled due to regressions on ZeBin enabling.
Re-enable again after fixes for:
* Implicit Arg bug for LocalID
* Incorrect vISA scratch space calculation for indirect calls

This commit includes fix for stackfuncs called from different sub_group_size requirements, in which case we cannot convert to indirect call.
Also, we prevent conversion to indirect calls if the CallWA is potentially needed.
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