[Bug ipa/103267] Wrong code with ipa-sra

2021-12-01 Thread jamborm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 Martin Jambor changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug ipa/103267] Wrong code with ipa-sra

2021-12-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #14 from CVS Commits --- The releases/gcc-9 branch has been updated by Martin Jambor : https://gcc.gnu.org/g:7dd5b92bbe0944dc27e6175b0df72ed0a7188016 commit r9-9852-g7dd5b92bbe0944dc27e6175b0df72ed0a7188016 Author: Martin Jambor

[Bug ipa/103267] Wrong code with ipa-sra

2021-12-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #13 from CVS Commits --- The releases/gcc-10 branch has been updated by Martin Jambor : https://gcc.gnu.org/g:d2ecc42195e8af1992d12e678e761c73557eaf56 commit r10-10318-gd2ecc42195e8af1992d12e678e761c73557eaf56 Author: Martin

[Bug ipa/103267] Wrong code with ipa-sra

2021-12-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #12 from CVS Commits --- The releases/gcc-11 branch has been updated by Martin Jambor : https://gcc.gnu.org/g:5e2e6cc84c46ff7ceb6395c0309a2c6b71d83cb1 commit r11-9347-g5e2e6cc84c46ff7ceb6395c0309a2c6b71d83cb1 Author: Martin Jambor

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-30 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #11 from CVS Commits --- The master branch has been updated by Martin Jambor : https://gcc.gnu.org/g:e5440bc08e07fd491dcccd47e1b86a5985ee117c commit r12-5633-ge5440bc08e07fd491dcccd47e1b86a5985ee117c Author: Martin Jambor Date:

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-30 Thread jamborm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #10 from Martin Jambor --- I have proposed a patch to address this issue in: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585756.html Well, it prevents the infinite loop testcase from segfaulting when the function

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread hubicka at kam dot mff.cuni.cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #9 from hubicka at kam dot mff.cuni.cz --- > @@ -1,4 +1,3 @@ > -static int > __attribute__ ((noinline,const)) > infinite (int p) > { Just for a record, it crahes with or without static int here for me :) I run across it because

Re: [Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread Jan Hubicka via Gcc-bugs
> @@ -1,4 +1,3 @@ > -static int > __attribute__ ((noinline,const)) > infinite (int p) > { Just for a record, it crahes with or without static int here for me :) I run across it because the code tracking must access in ipa-sra is IMO conceptually wrong. I noticed that because ipa-modref solves

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #8 from Martin Liška --- (In reply to hubicka from comment #6) > Aha, but here is better example (reproduces same way). > In the former one I forgot const attribute which makes it invalid. > The testcase tests that ipa-sra is

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 Martin Liška changed: What|Removed |Added Status|WAITING |NEW

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #7 from Martin Liška --- Now, I can reproduce it, the original code snippet was different: diff -u pr103267-o.c pr103267.c --- pr103267-o.c2021-11-16 09:47:41.463349286 +0100 +++ pr103267.c 2021-11-16 09:47:11.811550854

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread hubicka at kam dot mff.cuni.cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #6 from hubicka at kam dot mff.cuni.cz --- Aha, but here is better example (reproduces same way). In the former one I forgot const attribute which makes it invalid. The testcase tests that ipa-sra is missing ECF_LOOPING_CONST_OR_PURE

Re: [Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread Jan Hubicka via Gcc-bugs
Aha, but here is better example (reproduces same way). In the former one I forgot const attribute which makes it invalid. The testcase tests that ipa-sra is missing ECF_LOOPING_CONST_OR_PURE check static int __attribute__ ((noinline)) infinite (int p) { if (p) while (1); return p; }

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread hubicka at kam dot mff.cuni.cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #5 from hubicka at kam dot mff.cuni.cz --- Works for me even with the 3 warnings. hubicka@lomikamen:/aux/hubicka/trunk/build-lto2/gcc$ cat >tt.c __attribute__ ((noinline,const)) infinite (int p) { if (p) while (1); return p;

Re: [Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread Jan Hubicka via Gcc-bugs
Works for me even with the 3 warnings. hubicka@lomikamen:/aux/hubicka/trunk/build-lto2/gcc$ cat >tt.c __attribute__ ((noinline,const)) infinite (int p) { if (p) while (1); return p; } __attribute__ ((noinline)) static void test(int p, int *a) { int v = infinite (p); if (*a && v)

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #4 from Martin Liška --- Still, I can't reproduce with the current master. Apparently, the code snippet from #c0 produces only 2 warnings: $ gcc pr103267.c -c -O2 && ./a.out pr103267.c:17:1: warning: return type defaults to ‘int’

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #3 from Martin Liška --- Ah, ok, so no ICE, but wrong code.

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-16 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 --- Comment #2 from Jan Hubicka --- jan@localhost:~> gcc t.c t.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 2 | infinite (int p) | ^~~~ t.c:16:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 16 |

[Bug ipa/103267] Wrong code with ipa-sra

2021-11-15 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103267 Martin Liška changed: What|Removed |Added Last reconfirmed||2021-11-16