From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id A41B73857C79; Tue, 16 Nov 2021 08:42:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A41B73857C79 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 854852805A8; Tue, 16 Nov 2021 09:42:58 +0100 (CET) Date: Tue, 16 Nov 2021 09:42:58 +0100 From: Jan Hubicka To: "marxin at gcc dot gnu.org" Cc: gcc-bugs@gcc.gnu.org Subject: Re: [Bug ipa/103267] Wrong code with ipa-sra Message-ID: <20211116084258.GF71052@kam.mff.cuni.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2021 08:43:01 -0000 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) __builtin_abort (); } test2(int *a) { test(0,a); } main() { test (1,0); } hubicka@lomikamen:/aux/hubicka/trunk/build-lto2/gcc$ ./xgcc --version xgcc (GCC) 12.0.0 20211114 (experimental) Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. hubicka@lomikamen:/aux/hubicka/trunk/build-lto2/gcc$ ./xgcc -B ./ -O2 tt.c tt.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 2 | infinite (int p) | ^~~~~~~~ tt.c:16:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 16 | test2(int *a) | ^~~~~ tt.c:20:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 20 | main() | ^~~~ hubicka@lomikamen:/aux/hubicka/trunk/build-lto2/gcc$ ./a.out Segmentation fault