payload: {"action":"created","issue":{"url":"https://api.github.com/repos/verilog-to-routing/vtr-verilog-to-routing/issues/634","repository_url":"https://api.github.com/repos/verilog-to-routing/vtr-verilog-to-routing","labels_url":"https://api.github.com/repos/verilog-to-routing/vtr-verilog-to-routing/issues/634/labels{/name}","comments_url":"https://api.github.com/repos/verilog-to-routing/vtr-verilog-to-routing/issues/634/comments","events_url":"https://api.github.com/repos/verilog-to-routing/vtr-verilog-to-routing/issues/634/events","html_url":"https://github.com/verilog-to-routing/vtr-verilog-to-routing/issues/634","id":452233194,"node_id":"MDU6SXNzdWU0NTIyMzMxOTQ=","number":634,"title":"Clean-up GCC Compilation Warings when IPO enabled","user":{"login":"kmurray","id":1386492,"node_id":"MDQ6VXNlcjEzODY0OTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1386492?v=4","gravatar_id":"","url":"https://api.github.com/users/kmurray","html_url":"https://github.com/kmurray","followers_url":"https://api.github.com/users/kmurray/followers","following_url":"https://api.github.com/users/kmurray/following{/other_user}","gists_url":"https://api.github.com/users/kmurray/gists{/gist_id}","starred_url":"https://api.github.com/users/kmurray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmurray/subscriptions","organizations_url":"https://api.github.com/users/kmurray/orgs","repos_url":"https://api.github.com/users/kmurray/repos","events_url":"https://api.github.com/users/kmurray/events{/privacy}","received_events_url":"https://api.github.com/users/kmurray/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-06-04T22:20:16Z","updated_at":"2019-06-04T22:21:43Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!--- Provide a general summary of the issue in the Title above -->\r\n\r\n#### Expected Behaviour\r\n<!--- Tell us what should happen -->\r\nVTR should compile warning clean with gcc and Inter-Procedural/Link-Time Optimization (IPO/LTO).\r\n\r\n#### Current Behaviour\r\n<!--- Tell us what happens instead of the expected behaviour -->\r\n\r\nVPR compiles warning clean when `VTR_IPO_BUILD=off` (i.e. without IPO which is not the default). While most of our code is warning clean there are some files which we do not control which are not. In particular:\r\n1. Flex/Bison generated parsers (libsdcparse, libblifparse)\r\n2. pugixml\r\n\r\nTo handle this we have historically disabled all warnings (pugixml) or the specific offending warnings (flex/bison).\r\n\r\nHowever with IPO enabled, warnings similar to the following (from VPR) are produced at link time:\r\n```\r\n[100%] Linking CXX executable vpr\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In member function ‘save.constprop’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:4158:9: warning: potential null pointer dereference [-Wnull-dereference]\r\n 4158 |     if (PUGI__NODETYPE(node) == node_element)\r\n      |         ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_set_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:788:3: warning: potential null pointer dereference [-Wnull-dereference]\r\n  788 |   *compact_get_page(object, header_offset)->allocator->_hash->insert(object) = value;\r\n      |   ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_set_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:788:3: warning: potential null pointer dereference [-Wnull-dereference]\r\n  788 |   *compact_get_page(object, header_offset)->allocator->_hash->insert(object) = value;\r\n      |   ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_set_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:788:3: warning: potential null pointer dereference [-Wnull-dereference]\r\n  788 |   *compact_get_page(object, header_offset)->allocator->_hash->insert(object) = value;\r\n      |   ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_set_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:788:2: warning: potential null pointer dereference [-Wnull-dereference]\r\n  788 |   *compact_get_page(object, header_offset)->allocator->_hash->insert(object) = value;\r\n      |  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘_ZN4pugi4impl12_GLOBAL__N_118compact_hash_table6rehashEv.isra.0’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:380:31: warning: potential null pointer dereference [-Wnull-dereference]\r\n  380 |     *rt.insert(_items[i].key) = _items[i].value;\r\n      |                               ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_set_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:788:3: warning: potential null pointer dereference [-Wnull-dereference]\r\n  788 |   *compact_get_page(object, header_offset)->allocator->_hash->insert(object) = value;\r\n      |   ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_set_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:788:3: warning: potential null pointer dereference [-Wnull-dereference]\r\n  788 |   *compact_get_page(object, header_offset)->allocator->_hash->insert(object) = value;\r\n      |   ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_set_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:788:3: warning: potential null pointer dereference [-Wnull-dereference]\r\n  788 |   *compact_get_page(object, header_offset)->allocator->_hash->insert(object) = value;\r\n      |   ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_set_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:788:2: warning: potential null pointer dereference [-Wnull-dereference]\r\n  788 |   *compact_get_page(object, header_offset)->allocator->_hash->insert(object) = value;\r\n      |  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_set_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:788:3: warning: potential null pointer dereference [-Wnull-dereference]\r\n  788 |   *compact_get_page(object, header_offset)->allocator->_hash->insert(object) = value;\r\n      |   ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_get_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:2: warning: potential null pointer dereference [-Wnull-dereference]\r\n  783 |   return static_cast<T*>(*compact_get_page(object, header_offset)->allocator->_hash->find(object));\r\n      |  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:2: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:2: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_get_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:13: warning: potential null pointer dereference [-Wnull-dereference]\r\n  783 |   return static_cast<T*>(*compact_get_page(object, header_offset)->allocator->_hash->find(object));\r\n      |             ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:13: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:13: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_get_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n  783 |   return static_cast<T*>(*compact_get_page(object, header_offset)->allocator->_hash->find(object));\r\n      |                                                                                                  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_get_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n  783 |   return static_cast<T*>(*compact_get_page(object, header_offset)->allocator->_hash->find(object));\r\n      |                                                                                                  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_get_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n  783 |   return static_cast<T*>(*compact_get_page(object, header_offset)->allocator->_hash->find(object));\r\n      |                                                                                                  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_get_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n  783 |   return static_cast<T*>(*compact_get_page(object, header_offset)->allocator->_hash->find(object));\r\n      |                                                                                                  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_get_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n  783 |   return static_cast<T*>(*compact_get_page(object, header_offset)->allocator->_hash->find(object));\r\n      |                                                                                                  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_get_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n  783 |   return static_cast<T*>(*compact_get_page(object, header_offset)->allocator->_hash->find(object));\r\n      |                                                                                                  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In function ‘compact_get_value’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n  783 |   return static_cast<T*>(*compact_get_page(object, header_offset)->allocator->_hash->find(object));\r\n      |                                                                                                  ^\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:783:98: warning: potential null pointer dereference [-Wnull-dereference]\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp: In member function ‘offset_debug’:\r\n/project/trees/vtr2/libs/EXTERNAL/libpugixml/src/pugixml.cpp:6151:12: warning: potential null pointer dereference [-Wnull-dereference]\r\n 6151 |   if (!doc.buffer || doc.extra_buffers) return -1;\r\n      |            ^\r\n/project/trees/vtr2/build/libs/EXTERNAL/libsdcparse/sdc_lexer.gen.cpp: In function ‘yy_get_next_buffer’:\r\n/project/trees/vtr2/build/libs/EXTERNAL/libsdcparse/sdc_lexer.gen.cpp:2102:9: warning: potential null pointer dereference [-Wnull-dereference]\r\n 2102 |  b->yy_fill_buffer = 1;\r\n      |         ^\r\n/project/trees/vtr2/build/libs/EXTERNAL/libsdcparse/sdc_lexer.gen.cpp:2101:9: warning: potential null pointer dereference [-Wnull-dereference]\r\n 2101 |  b->yy_input_file = file;\r\n      |         ^\r\n/project/trees/vtr2/build/libs/EXTERNAL/libsdcparse/sdc_lexer.gen.cpp:2102:9: warning: potential null pointer dereference [-Wnull-dereference]\r\n 2102 |  b->yy_fill_buffer = 1;\r\n      |         ^\r\n/project/trees/vtr2/build/libs/EXTERNAL/libsdcparse/sdc_lexer.gen.cpp:2101:9: warning: potential null pointer dereference [-Wnull-dereference]\r\n 2101 |  b->yy_input_file = file;\r\n      |         ^\r\n/project/trees/vtr2/build/libs/EXTERNAL/libblifparse/blif_parser.gen.cpp: In member function ‘yysyntax_error_’:\r\n/project/trees/vtr2/build/libs/EXTERNAL/libblifparse/blif_parser.gen.cpp:1192:38: warning: potential null pointer dereference [-Wnull-dereference]\r\n 1192 |     for (char const* yyp = yyformat; *yyp; ++yyp)\r\n      |                                      ^\r\n/project/trees/vtr2/build/libs/EXTERNAL/libsdcparse/sdc_parser.gen.cpp: In member function ‘yysyntax_error_’:\r\n/project/trees/vtr2/build/libs/EXTERNAL/libsdcparse/sdc_parser.gen.cpp:1716:38: warning: potential null pointer dereference [-Wnull-dereference]\r\n 1716 |     for (char const* yyp = yyformat; *yyp; ++yyp)\r\n      |                                      ^\r\n[100%] Built target vpr\r\n```\r\n\r\n#### Possible Solution\r\n<!--- Not obligatory, but suggest a fix/reason for the bug -->\r\nNot clear, it seems when run with LTO warning suppression options which were applied to specific source files are not carried over during linking.\r\nThis is perhaps not so surprising since LTO breaks the historical single compilation unit model.\r\n\r\nHowever it seems like GCC should really respect the warning flags when the source file was originally compiled even when doing LTO, so perhaps this is really a GCC bug.\r\n\r\nPreviously this was not an issue as we only applied LTO to vpr, but that caused crashes in GCC (#628), and the fix now causes all code (including the pugixml, libblifparse, and libsdcparse) to be built with LTO exposing this issue.\r\n\r\n#### Steps to Reproduce\r\n<!--- Provide an unambiguous set of steps to reproduce this bug. -->\r\n<!--- Include the exact command line arguments and source files -->\r\n<!-- (e.g. architecture file, netlist) to reproduce, if relevant. -->\r\n1. `CC=gcc-9 CXX=g++-9 make`\r\n\r\n#### Context\r\n<!--- How has this issue affected you? What are you trying to accomplish? -->\r\n<!--- Providing context helps us come up with a solution that is most useful in the real world -->\r\nKeeping the code compiling with no warnings is important for code quality as it ensures newly introduced warnings about suspect code are immediately noticed.\r\n\r\n#### Your Environment\r\n<!--- Include as many relevant details about the environment you experienced the bug in. -->\r\n* VTR revision used: 2f9bcd5e5\r\n* Operating System and version: Ubuntu 18.04\r\n* Compiler version: gcc-9\r\n"},"comment":{"url":"https://api.github.com/repos/verilog-to-routing/vtr-verilog-to-routing/issues/comments/498865243","html_url":"https://github.com/verilog-to-routing/vtr-verilog-to-routing/issues/634#issuecomment-498865243","issue_url":"https://api.github.com/repos/verilog-to-routing/vtr-verilog-to-routing/issues/634","id":498865243,"node_id":"MDEyOklzc3VlQ29tbWVudDQ5ODg2NTI0Mw==","user":{"login":"kmurray","id":1386492,"node_id":"MDQ6VXNlcjEzODY0OTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1386492?v=4","gravatar_id":"","url":"https://api.github.com/users/kmurray","html_url":"https://github.com/kmurray","followers_url":"https://api.github.com/users/kmurray/followers","following_url":"https://api.github.com/users/kmurray/following{/other_user}","gists_url":"https://api.github.com/users/kmurray/gists{/gist_id}","starred_url":"https://api.github.com/users/kmurray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmurray/subscriptions","organizations_url":"https://api.github.com/users/kmurray/orgs","repos_url":"https://api.github.com/users/kmurray/repos","events_url":"https://api.github.com/users/kmurray/events{/privacy}","received_events_url":"https://api.github.com/users/kmurray/received_events","type":"User","site_admin":false},"created_at":"2019-06-04T22:21:43Z","updated_at":"2019-06-04T22:21:43Z","author_association":"CONTRIBUTOR","body":"@mithro FYI"}}
other: {"actor":{"display_login":"kmurray"}}