[Bug debug/89528] New: Wrong debug info generated at -Og [gcc-trunk]

2019-02-27 Thread dccitaliano at gmail dot com
: debug Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- $ cat 5.c char b; int d, e; static int i = 1; void a(l) { printf("", l); } char(c)(char l) { return l || b && l == 1 ? b : b % l; } short(f)(l, m) { ret

[Bug debug/89529] New: Wrong debug info generated at -Og [gcc-trunk]

2019-02-27 Thread dccitaliano at gmail dot com
: debug Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- $ cat 2.c int a; void b() { short l_1862 = 19071; a = 0; for (; 0;) optimize_me_not(); --l_1862; } int main() { b(); } $ cat outer.c void optimize_me_not

[Bug debug/89529] Wrong debug info generated at -Og [gcc-trunk]

2019-02-27 Thread dccitaliano at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89529 --- Comment #1 from dcci --- The breakpoint is set on the line where the decrement happens, so it should probably print the value before the decrement (at -Og)

[Bug debug/89530] New: Wrong debug informations for C array generated at -Og [gcc-trunk]

2019-02-27 Thread dccitaliano at gmail dot com
Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- $ cat a.c int e, g; short f; char h; short(a)(b) {} int(c)(d) {} void i() { int j, k; unsigned short l_1404[3][9] = {58143, 8

[Bug debug/89530] Wrong debug informations for C array generated at -Og [gcc-trunk]

2019-03-01 Thread dccitaliano at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89530 --- Comment #2 from dcci --- Thanks Jakub. We're trying to report more of these but it's hard to filter out duplicates. A possible way we thought was that of stopping at some point in the pipeline (so running a subset of the optimizations), to id

[Bug debug/89530] Wrong debug informations for C array generated at -Og [gcc-trunk]

2019-03-01 Thread dccitaliano at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89530 --- Comment #5 from dcci --- (In reply to Jakub Jelinek from comment #4) > Also, we usually bisect which gcc revision introduced a problem and from > that change we can often see what goes wrong quickly. Both Red Hat and SUSE > have terrabytes o

[Bug debug/89530] Wrong debug informations for C array generated at -Og [gcc-trunk]

2019-03-01 Thread dccitaliano at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89530 --- Comment #7 from dcci --- (In reply to Jakub Jelinek from comment #6) > (In reply to dcci from comment #5) > > (In reply to Jakub Jelinek from comment #4) > > > Also, we usually bisect which gcc revision introduced a problem and from > > > tha

[Bug tree-optimization/117033] GCC trunk emits larger code at -Os compared to -O2

2024-10-08 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117033 --- Comment #6 from Davide Italiano --- I noticed you linked the LLVM bug I found. As part of my search/analysis, I found out there are cases that sometimes clang gets but GCC doesn't (unsurprisingly, FWIW). Here's a simple one. https://godbol

[Bug tree-optimization/117033] GCC trunk emits larger code at -Os compared to -O2

2024-10-08 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117033 --- Comment #8 from Davide Italiano --- (In reply to Andrew Pinski from comment #7) > (In reply to Davide Italiano from comment #6) > > I noticed you linked the LLVM bug I found. > > As part of my search/analysis, I found out there are cases th

[Bug middle-end/117123] New: [12/13/14/15 regression] Generated code at -Os on trunk is larger than GCC 14.4

2024-10-13 Thread dccitaliano at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- https://godbolt.org/z/ern8cbPzr Inline code: struct Potato

[Bug middle-end/117128] New: [15 regression] GCC trunk generates larger code than GCC 14 at -Os/OZ

2024-10-13 Thread dccitaliano at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- int f(int a) { int result = 0; for (int i = 0; i < a && (i % 2 == 0 || a > 10); i++) { result

[Bug target/117103] GCC trunk emits push + pop at -Oz when a mov could suffice

2024-10-11 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117103 --- Comment #3 from Davide Italiano --- > Note if you are doing code size comparison, then looking at the # of > instructions for a target like x86 is not the way to go. You need to actually > look at the assembled instruction output. Oops, m

[Bug target/117128] [15 regression] GCC trunk generates larger code than GCC 14 at -Os/Oz

2024-10-15 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117128 Davide Italiano changed: What|Removed |Added CC||rguenth at gcc dot gnu.org --- Commen

[Bug target/117103] New: GCC trunk emits push + pop at -Oz when a mov could suffice

2024-10-11 Thread dccitaliano at gmail dot com via Gcc-bugs
Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- Not a big deal, and maybe there are cases where it's not profitable, but I found this while testing: https://clang.godbolt.

[Bug middle-end/117033] New: GCC trunk emits larger code at -Oz compared to -O2

2024-10-08 Thread dccitaliano at gmail dot com via Gcc-bugs
Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- long patatino() { long x = 0; for (int i = 0; i < 5; ++i) { while (x < 37) { if (x % 4 == 0) {

[Bug tree-optimization/117033] GCC trunk emits larger code at -Oz compared to -O2

2024-10-08 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117033 --- Comment #3 from Davide Italiano --- (In reply to Davide Italiano from comment #2) > Sorry, modified the title. This is `-Oz`, not `-Os` Writing this because you mentioned it blocks `-Os`, fwiw.

[Bug tree-optimization/117033] GCC trunk emits larger code at -Oz compared to -O2

2024-10-08 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117033 Davide Italiano changed: What|Removed |Added Blocks|103916 | Summary|GCC trunk emits l

[Bug middle-end/116994] New: [15 regression] GCC trunk generates larger code than GCC 14 at -Os

2024-10-06 Thread dccitaliano at gmail dot com via Gcc-bugs
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- I found this at -Os and I figured I could report it. For this specific (reduced) small example, GCC trunk generates code

[Bug target/117006] New: [15 regression] GCC trunk generates larger code than GCC 14 at -Os

2024-10-07 Thread dccitaliano at gmail dot com via Gcc-bugs
Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- Similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116994 https://godbolt.org/z/64bxGvnrh long patatino() { long x

[Bug tree-optimization/117253] New: [14/15 regression] Generated code at -Os on trunk is larger than GCC 13.3

2024-10-21 Thread dccitaliano at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- https://gcc.godbolt.org/z/cqvMzPd4d Inline code: int f(int a) { int* ptr = &a; int result = *ptr;

[Bug target/117253] [14/15 regression] Generated code at -Os on trunk is larger than GCC 13.3

2024-10-21 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117253 Davide Italiano changed: What|Removed |Added CC||rguenth at gcc dot gnu.org --- Commen

[Bug rtl-optimization/117128] [15 regression] GCC trunk generates larger code than GCC 14 at -Os/Oz since r14-2161-g237e83e2158a3d

2024-10-22 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117128 --- Comment #5 from Davide Italiano --- Another example: int f(int a) { int arr[5]; for (int i = 0; i < 5; i++) { if (i % 2 == 0 && a > 5 || i % 3 == 0 && a < -2) { arr[i] = a + i * 2; } else { arr[i] = a + i; } }

[Bug target/117253] [14/15 regression] Generated code at -Os on trunk is larger than GCC 13.3

2024-10-22 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117253 --- Comment #6 from Davide Italiano --- (In reply to Richard Biener from comment #4) > So probably IVOPTs related. With -fno-ivopts code generated by GCC 13 and > trunk are about the same size. Slightly less contrived example that points to th

[Bug target/117253] [14/15 regression] Generated code at -Os on trunk is larger than GCC 13.3

2024-10-22 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117253 --- Comment #5 from Davide Italiano --- (In reply to Sam James from comment #3) > Davide, was this reduced from a real application or are you > fuzzing/experimenting? (The reports are welcome either way.) Hi Sam, these are not reduced by a real

[Bug middle-end/117271] New: [13/14/15 regression] GCC trunk emits larger code at -Os than 12.4.0

2024-10-23 Thread dccitaliano at gmail dot com via Gcc-bugs
Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- Testcase (-Os): int f(int* a) { if (*a > 5 && ((*a % 2 == 0 && *a < 20) || (*a > 10 &&

[Bug middle-end/117271] [13/14/15 regression] GCC trunk emits larger code at -Os than 12.4.0

2024-10-23 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117271 --- Comment #1 from Davide Italiano --- https://godbolt.org/z/eExfPsjzs

[Bug middle-end/117123] [12/13/14/15 regression] Generated code at -Os on trunk is larger than GCC 14.4

2024-10-13 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117123 --- Comment #1 from Davide Italiano --- I'd like to point out that in GCC-13.3 this seems to emit much shorter code: i.e. https://godbolt.org/z/YEvbs14PY _Z8patatinoi: movl%edi, %eax cmpl$5, %edi jle .L2

[Bug rtl-optimization/117278] New: [12/13/14/15 regression] Code at -Os is larger on trunk than GCC 11.4.0

2024-10-23 Thread dccitaliano at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- Looks like this regressed in GCC 12 and has never recovered since. Testcase (https://godbolt.org/z/T1vvzWjvK

[Bug target/117253] [14/15 regression] Generated code at -Os on trunk is larger than GCC 13.3

2024-10-25 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117253 --- Comment #7 from Davide Italiano --- (In reply to Richard Biener from comment #4) > So probably IVOPTs related. With -fno-ivopts code generated by GCC 13 and > trunk are about the same size. For the second example (see code above) -- `-fno-

[Bug middle-end/116751] New: GCC trunk (-O3) doesn't optimize a loop that can be folded into a constant

2024-09-17 Thread dccitaliano at gmail dot com via Gcc-bugs
erity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- https://godbolt.org/z/qq1bbdMKn ``` #include int64_t patatino() { int64_t result = 0; for (int r =

[Bug middle-end/116753] New: [regression from GCC 12.4] GCC trunk (-O3) can't fold a loop into a constant

2024-09-17 Thread dccitaliano at gmail dot com via Gcc-bugs
IRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- https://godbolt.org/z/xGh9vY57b ``` long patatino() { long x = 0; for (int i = 0; i <

[Bug middle-end/116753] [13/14/15 Regression] GCC trunk (-O3) can't fold a loop into a constant

2024-09-18 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116753 --- Comment #3 from dcci --- Slightly easier example that still fails (no nested loop): ``` long patatino() { long x = 0; while (x < 10) { if (x % 2 == 0) { x += 2; } else { x += 1

[Bug middle-end/116868] New: GCC trunk doesn't eliminate a superfluous new/delete pair

2024-09-27 Thread dccitaliano at gmail dot com via Gcc-bugs
ormal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- Maybe this is known, but i wasn't able to find the exact duplicate. (this is the closest I found -- apologies for the chu

[Bug target/117278] [12/13/14/15 regression] Code at -Os is larger on trunk than GCC 11.4.0 since r12-6149-gdc1969dab39266

2024-11-06 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117278 --- Comment #4 from Davide Italiano --- (In reply to Davide Italiano from comment #3) > Another example that I found while looking at this: > > int f(int* a) { > int sum = *a; > for (int i = 0; i < 10; i++) { > if (i % 2 == 0 && (i > 3

[Bug middle-end/117160] New: [15 regression] GCC trunk generates larger code than GCC 14 at -Os/-Oz (progressed in 14)

2024-10-15 Thread dccitaliano at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: dccitaliano at gmail dot com Target Milestone: --- https://godbolt.org/z/764Gs8Tvf Inline code: struct X { int size; char color; }; int f(int a

[Bug target/116994] [15 regression] GCC trunk generates larger code than GCC 14 at -Os

2024-10-15 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116994 Davide Italiano changed: What|Removed |Added CC||lingling.kong7 at gmail dot com --- C

[Bug middle-end/117123] [14/15 regression] Generated code at -Os on trunk is larger than GCC 14.4

2024-10-15 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117123 Davide Italiano changed: What|Removed |Added CC||pheeck at gcc dot gnu.org,

[Bug target/117278] [12/13/14/15 regression] Code at -Os is larger on trunk than GCC 11.4.0 since r12-6149-gdc1969dab39266

2024-11-06 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117278 --- Comment #3 from Davide Italiano --- Another example that I found while looking at this: int f(int* a) { int sum = *a; for (int i = 0; i < 10; i++) { if (i % 2 == 0 && (i > 3 || *a < 5)) { for (int j = 0; j < 5; j++) {

[Bug rtl-optimization/117128] [15 regression] GCC trunk generates larger code than GCC 14 at -Os/Oz since r14-2161-g237e83e2158a3d

2024-11-06 Thread dccitaliano at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117128 --- Comment #6 from Davide Italiano --- Yet another example: int f(int* a) { int sum = *a; for (int i = 0; i < 10; i++) { if (i % 2 == 0 && (i > 3 || *a < 5)) { for (int j = 0; j < 5; j++) { if (j > 2 && sum > 0) {