[Bug c/107405] enums can be wrongly long in gcc-13 (in gnu99)

2022-10-26 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405 --- Comment #11 from Jiri Slaby --- (In reply to Jiri Slaby from comment #10) > Ah, that's correct. So the question then is: is it a feature we can rely on > (even if undocumented -- can the behavior can be documented in gcc?), or we > should

[Bug c/107405] enums can be wrongly long in gcc-13 (in gnu99)

2022-10-26 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405 --- Comment #10 from Jiri Slaby --- (In reply to Jonathan Wakely from comment #9) > (In reply to Jiri Slaby from comment #4) > > Another question is why B is affected by A at all? Also sizeof of that enum > > (if one gives it a name) is 8 with

[Bug c/107405] enums can be wrongly long in gcc-13 (in gnu99)

2022-10-26 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405 --- Comment #7 from Jiri Slaby --- (In reply to Jakub Jelinek from comment #6) > That is how C++ behaves for years and C2X mandates such behavior too. > Enumerators that don't fit into int were a GNU extensions (-pedantic-errors > rejects them)

[Bug c/107405] enums can be wrongly long in gcc-13 (in gnu99)

2022-10-26 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405 --- Comment #5 from Jiri Slaby --- (In reply to Jiri Slaby from comment #4) > Also sizeof of that enum > (if one gives it a name) is 8 with gcc-13. That is not allowed by the > standard, IMO. I'm correcting myself, this was always the case and

[Bug c/107405] enums can be wrongly long in gcc-13 (in gnu99)

2022-10-26 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405 --- Comment #4 from Jiri Slaby --- (In reply to Martin Liška from comment #3) > > enum { A = 0x, B = 1 << 31, }; > > int main() { printf("%lx %x %zu\n", A, B, sizeof(B)); } > > > > Apparently, 0x is treated by the compiler as

[Bug c/107405] enums can be wrongly long in gcc-13 (in gnu99)

2022-10-25 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405 --- Comment #1 from Jiri Slaby --- (In reply to Jiri Slaby from comment #0) > Reduced testcase: > #include > enum { A = 0x, B = 1 << 31, }; > int main() { printf("%lx %x %zu\n", A, B, sizeof(B)); } It's also interesting to me, that A

[Bug c/107405] New: enums can be long in gcc-13

2022-10-25 Thread jirislaby at gmail dot com via Gcc-bugs
Assignee: unassigned at gcc dot gnu.org Reporter: jirislaby at gmail dot com Target Milestone: --- While compiling the kernel (next/master -- 89bf6e28373beef9) with gcc-13, I see: drivers/block/mtip32xx/mtip32xx.c:722:25: error: format '%x' expects argument of type 'unsigned int', but argument

[Bug lto/107014] flatten+lto fails the kernel build

2022-09-23 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107014 --- Comment #6 from Jiri Slaby --- (In reply to Alexander Monakov from comment #5) > I mean now, about compile time blowup with LTO. No, LTO is not supported by upstream (yet) ;). The point is what should I do when submitting the LTO support.

[Bug lto/107014] flatten+lto fails the kernel build

2022-09-23 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107014 --- Comment #4 from Jiri Slaby --- (In reply to Alexander Monakov from comment #3) > It was added to force inlining of small helpers that outgrow limits when > building with gcov profiling: (with clang) > I am surprised that "flatten" blows

[Bug lto/107014] New: flatten+lto

2022-09-23 Thread jirislaby at gmail dot com via Gcc-bugs
: unassigned at gcc dot gnu.org Reporter: jirislaby at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- Maybe this is simply a dup of bug 77472, but I am not sure what the proper solution is supposed to be. In the kernel, when LTO is enabled, we disable flatten

[Bug lto/99828] inlining failed in call to ‘always_inline’ ‘memcpy’: --param max-inline-insns-auto limit reached

2022-09-23 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99828 --- Comment #14 from Jiri Slaby --- (In reply to Richard Biener from comment #13) > The testcase still does not work on master or with 12.2, thus reconfirmed. Hmm: (In reply to Martin Liška from comment #0) > Noticed by Andi Kleen in kernel,

[Bug lto/99828] inlining failed in call to ‘always_inline’ ‘memcpy’: --param max-inline-insns-auto limit reached

2022-09-22 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99828 --- Comment #12 from Jiri Slaby --- (In reply to Jiri Slaby from comment #11) > Looking at the kernel patch, it says: > This is fixed now in gcc, but work around it on older compilers > by using a wrapper. > > If so, how was this fixed

[Bug lto/99828] inlining failed in call to ‘always_inline’ ‘memcpy’: --param max-inline-insns-auto limit reached

2022-09-22 Thread jirislaby at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99828 Jiri Slaby changed: What|Removed |Added CC||jirislaby at gmail dot com --- Comment #11

[Bug middle-end/77964] [7 Regression] Linux kernel firmware loader miscompiled

2016-10-18 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77964 --- Comment #16 from Jiri Slaby --- (In reply to Jakub Jelinek from comment #15) > lots of them that rely on pointer arithmetics being defined only within the > same object. Sure, but the two pointers (taken implicitly of the arrays) are within

[Bug middle-end/77964] [7 Regression] Linux kernel firmware loader miscompiled

2016-10-18 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77964 --- Comment #14 from Jiri Slaby --- (In reply to Andrew Pinski from comment #10) > (In reply to Markus Trippelsdorf from comment #9) > > Is subtracting undefined, too? > Yes. Comparing two unrelated arrays or subtracting them is undefined. But

[Bug middle-end/77981] New: gcc 7 miscompiles kernel

2016-10-13 Thread jirislaby at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: jirislaby at gmail dot com Target Milestone: --- I am using gcc-7 (SUSE Linux) 7.0.0 20161007 (experimental) from martin liska's https://build.opensuse.org/project/show/home:marxin:syzkaller And the kernel does not boot. It is looping

[Bug c/69624] sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69624 --- Comment #5 from Jiri Slaby --- (In reply to Jakub Jelinek from comment #4) > What gcc options are you using on the preprocessed source to trigger this? By default this: gcc-6 -nostdinc -fno-strict-aliasing -fno-common -std=gnu89 -mno-sse

[Bug c/69624] sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69624 --- Comment #9 from Jiri Slaby --- (In reply to Dmitry Vyukov from comment #8) > First of all, are you sure that r12 is not 0 before the call? Yes. > Deference of 0xdc00 is how KASAN reacts on NULL deref, it does > shadow check

[Bug c/69624] sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69624 --- Comment #7 from Jiri Slaby --- (In reply to Dmitry Vyukov from comment #6) > Also what gcc version? $ gcc-6 --version gcc-6 (SUSE Linux) 6.0.0 20160121 (experimental) [trunk revision 232670] > I've tried: > gcc version 6.0.0 20160105

[Bug c/69624] sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69624 --- Comment #12 from Jiri Slaby --- (In reply to Jiri Slaby from comment #11) > __sw_hweight32 changes only retval (rax) and parameter (rdi). ... and rdi is stored to and restored from stack.

[Bug c/69624] sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69624 --- Comment #11 from Jiri Slaby --- (In reply to Jakub Jelinek from comment #10) > If you are calling a function (__sw_hweight32) without letting gcc know you > do that, are you sure that function call does not modify any registers other > than

[Bug c/69624] sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69624 --- Comment #15 from Jiri Slaby --- (In reply to Dmitry Vyukov from comment #14) > If you apply the latest kcov patch "[PATCH v6] kernel: add kcov code > coverage", it should work. Could you please push that to the syzkaller tree [1] then? [1]

[Bug c/69624] New: sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
Assignee: unassigned at gcc dot gnu.org Reporter: jirislaby at gmail dot com Target Milestone: --- I have commit a8175057d14fa8ff8cc4589edf55a6855d9afdf4 Author: Dmitry Vyukov <dvyu...@google.com> Date: Mon Nov 9 19:59:08 2015 +0100 new coverage that uses shared

[Bug c/69624] sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69624 --- Comment #1 from Jiri Slaby --- Created attachment 37552 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37552=edit __sw_hweight32 assembly

[Bug c/69624] sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69624 --- Comment #2 from Jiri Slaby --- Created attachment 37553 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37553=edit __sanitizer_cov_trace_pc implementation This guys actually changes rdx.

[Bug c/69624] sanitize-coverage=trace-pc miscompiles kernel

2016-02-02 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69624 --- Comment #3 from Jiri Slaby --- Preprocessed code: http://www.fi.muni.cz/~xslaby/sklad/af_netlink.i This one results in the code from initial description. I.e. rdx is loaded before a call.

[Bug c/65120] New: [gcc5] Wlogical-not-parentheses should not wanr about double exclamation !!

2015-02-19 Thread jirislaby at gmail dot com
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jirislaby at gmail dot com While warning about if (!a == b) is perfectly fine and I like it, I do not like warning about if (!!a = b) at all. It generates plenty of false

[Bug c/65120] [gcc5] Wlogical-not-parentheses should not warn about double exclamation !!

2015-02-19 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65120 --- Comment #1 from Jiri Slaby jirislaby at gmail dot com --- (In reply to Jiri Slaby from comment #0) Better than papering over this as if ((!aa) = b) Pardon me, it should write: if ((!!aa) = b)

[Bug c/65040] [5 Regression] gcc-5 -Wformat broken

2015-02-14 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65040 --- Comment #9 from Jiri Slaby jirislaby at gmail dot com --- What about this? #include stdio.h void x(char *ch) { printf(%x\n, ch[10]); } It still produces the warning. (I cannot reopen as I am not a reporter.)

[Bug c/65040] [5 Regression] gcc-5 -Wformat broken

2015-02-14 Thread jirislaby at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65040 --- Comment #12 from Jiri Slaby jirislaby at gmail dot com --- (In reply to Marek Polacek from comment #10) That's because on your architecture char is signed by default. Try adding unsigned or using -funsigned-char and the warning should