RESOLVED FIXED 239897
[GCC] REGRESSION(r293605): error: cannot convert ‘<brace-enclosed initializer list>’ to ‘unsigned char:3’ in initialization
https://bugs.webkit.org/show_bug.cgi?id=239897
Summary [GCC] REGRESSION(r293605): error: cannot convert ‘<brace-enclosed initializer...
Diego Pino
Reported 2022-04-29 05:31:26 PDT
The Debian 10 build bot (GCC 8.3) is failing with the following error: ``` ./../Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h:113:43: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘unsigned char:3’ in initialization ``` https://build.webkit.org/#/builders/46/builds/13117 It seems setting the bit size of a typed enum is not supported by GCC8.3.
Attachments
Patch (1.47 KB, patch)
2022-04-29 05:37 PDT, Diego Pino
no flags
Patch (1.62 KB, patch)
2022-05-04 19:36 PDT, Diego Pino
no flags
[fast-cq] Patch (1.65 KB, patch)
2022-05-04 23:31 PDT, Diego Pino
ews-feeder: commit-queue-
Patch (1.64 KB, patch)
2022-05-05 00:39 PDT, Diego Pino
no flags
Diego Pino
Comment 1 2022-04-29 05:37:37 PDT
Darin Adler
Comment 2 2022-05-03 17:02:01 PDT
Comment on attachment 458583 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458583&action=review > Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h:111 > - Kind m_kind : bitsOfKind { Kind::None }; > + Kind m_kind { Kind::None }; I believe this will make the object larger. Can we keep the optimization under other compilers?
Yusuke Suzuki
Comment 3 2022-05-03 18:42:19 PDT
Comment on attachment 458583 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458583&action=review >> Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h:111 >> + Kind m_kind { Kind::None }; > > I believe this will make the object larger. Can we keep the optimization under other compilers? Yes, this needs to be small. So, we need different solution.
Darin Adler
Comment 4 2022-05-04 14:59:40 PDT
Comment on attachment 458583 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458583&action=review >>> Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h:111 >>> + Kind m_kind { Kind::None }; >> >> I believe this will make the object larger. Can we keep the optimization under other compilers? > > Yes, this needs to be small. So, we need different solution. Should be able to work around this by using the type unsigned and casting to and from Kind when accessing the data member. It would be a shame to do that forever though. We want to work around the problem somehow in a way that can easily be removed once gcc is sufficiently improved.
Diego Pino
Comment 5 2022-05-04 19:36:55 PDT
Yusuke Suzuki
Comment 6 2022-05-04 23:12:27 PDT
Comment on attachment 458842 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458842&action=review r=me with comment. > Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h:50 > + MethodOfGettingAValueProfile() { m_kind = Kind::None; } Please use initialization list, and annotate it with constexpr. constexpr MethodOfGettingAValueProfile() : m_kind(Kind::None) { }
Diego Pino
Comment 7 2022-05-04 23:31:42 PDT
Created attachment 458852 [details] [fast-cq] Patch
Diego Pino
Comment 8 2022-05-05 00:23:28 PDT
(In reply to Yusuke Suzuki from comment #6) > Comment on attachment 458842 [details] > Patch > Please use initialization list, and annotate it with constexpr. > > constexpr MethodOfGettingAValueProfile() > : m_kind(Kind::None) > { > } It seems the constructor cannot be `constexpr`. ``` /app/webkit/Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h: In constructor ‘constexpr JSC::MethodOfGettingAValueProfile::MethodOfGettingAValueProfile()’: /app/webkit/Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.h:51:28: error: call to non-‘constexpr’ function ‘JSC::CodeOrigin::CodeOrigin()’ 51 | : m_kind(Kind::None) ```
Diego Pino
Comment 9 2022-05-05 00:39:19 PDT
EWS
Comment 10 2022-05-05 05:14:00 PDT
Committed r293828 (250301@main): <https://commits.webkit.org/250301@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458855 [details].
Radar WebKit Bug Importer
Comment 11 2022-05-05 05:15:15 PDT
Note You need to log in before you can comment on or make changes to this bug.