: 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
: 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
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)
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
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
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
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
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
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
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
: 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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117128
Davide Italiano changed:
What|Removed |Added
CC||rguenth at gcc dot gnu.org
--- Commen
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.
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) {
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.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117033
Davide Italiano changed:
What|Removed |Added
Blocks|103916 |
Summary|GCC trunk emits l
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
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
: 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;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117253
Davide Italiano changed:
What|Removed |Added
CC||rguenth at gcc dot gnu.org
--- Commen
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;
}
}
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
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
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 &&
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117271
--- Comment #1 from Davide Italiano ---
https://godbolt.org/z/eExfPsjzs
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
: 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
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-
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 =
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 <
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
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
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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116994
Davide Italiano changed:
What|Removed |Added
CC||lingling.kong7 at gmail dot com
--- C
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117123
Davide Italiano changed:
What|Removed |Added
CC||pheeck at gcc dot gnu.org,
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++) {
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) {
39 matches
Mail list logo