public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@kam.mff.cuni.cz>
To: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
Cc: gcc-bugs@gcc.gnu.org
Subject: Re: [Bug ipa/103267] Wrong code with ipa-sra
Date: Tue, 16 Nov 2021 09:42:58 +0100	[thread overview]
Message-ID: <20211116084258.GF71052@kam.mff.cuni.cz> (raw)
In-Reply-To: <bug-103267-4-DfbioEf2MD@http.gcc.gnu.org/bugzilla/>

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



  reply	other threads:[~2021-11-16  8:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 22:02 [Bug ipa/103267] New: " hubicka at gcc dot gnu.org
2021-11-16  7:58 ` [Bug ipa/103267] " marxin at gcc dot gnu.org
2021-11-16  8:26 ` hubicka at gcc dot gnu.org
2021-11-16  8:31 ` marxin at gcc dot gnu.org
2021-11-16  8:34 ` marxin at gcc dot gnu.org
2021-11-16  8:42   ` Jan Hubicka [this message]
2021-11-16  8:43 ` hubicka at kam dot mff.cuni.cz
2021-11-16  8:47   ` Jan Hubicka
2021-11-16  8:48 ` hubicka at kam dot mff.cuni.cz
2021-11-16  8:48 ` marxin at gcc dot gnu.org
2021-11-16  8:54   ` Jan Hubicka
2021-11-16  8:48 ` marxin at gcc dot gnu.org
2021-11-16  8:50 ` marxin at gcc dot gnu.org
2021-11-16  8:54 ` hubicka at kam dot mff.cuni.cz
2021-11-30 14:31 ` jamborm at gcc dot gnu.org
2021-11-30 17:45 ` cvs-commit at gcc dot gnu.org
2021-12-01 13:24 ` cvs-commit at gcc dot gnu.org
2021-12-01 13:27 ` cvs-commit at gcc dot gnu.org
2021-12-01 17:30 ` cvs-commit at gcc dot gnu.org
2021-12-01 17:33 ` jamborm at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211116084258.GF71052@kam.mff.cuni.cz \
    --to=hubicka@kam.mff.cuni.cz \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-bugzilla@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).