public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/100036] New: missed optimization for dead code elimination at -Os, -O2 and -O3 (vs. -O1)
@ 2021-04-11 15:56 zhendong.su at inf dot ethz.ch
  2021-04-12  8:56 ` [Bug ipa/100036] " rguenth at gcc dot gnu.org
  2021-04-12  8:56 ` rguenth at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2021-04-11 15:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100036

            Bug ID: 100036
           Summary: missed optimization for dead code elimination at -Os,
                    -O2 and -O3 (vs. -O1)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

[562] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/11.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.1 20210411 (experimental) [master revision
1d54b138417:e83b9cf4549:936d500dfc17f58f2507ecd0f7f26e4f197052ee] (GCC) 
[563] % 
[563] % gcctk -O1 -S -o O1.s small.c
[564] % gcctk -O3 -S -o O3.s small.c
[565] % 
[565] % wc O1.s O3.s
  27   58  454 O1.s
  38   77  665 O3.s
  65  135 1119 total
[566] % 
[566] % grep foo O1.s
[567] % grep foo O3.s
        jmp     foo
[568] % 
[568] % cat small.c
extern void foo(void);
int a, *b;
static int c, f;
inline int *d() {
  int g[100] = {0};
  if (a) {
    int h = g[0];
    foo();
    return b;
  }
}
int main() {
  while (1) {
    if (!c)
      return f;
    d();
  }
  return 0;
}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ipa/100036] missed optimization for dead code elimination at -Os, -O2 and -O3 (vs. -O1)
  2021-04-11 15:56 [Bug ipa/100036] New: missed optimization for dead code elimination at -Os, -O2 and -O3 (vs. -O1) zhendong.su at inf dot ethz.ch
@ 2021-04-12  8:56 ` rguenth at gcc dot gnu.org
  2021-04-12  8:56 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-12  8:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100036

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |11.0
         Depends on|                            |99991
           Keywords|                            |missed-optimization

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
And again, missing late dead function removal of an IPA SRA clone not inlined
at -O3.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99991
[Bug 99991] Missed inlining of IPA SRA clone

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ipa/100036] missed optimization for dead code elimination at -Os, -O2 and -O3 (vs. -O1)
  2021-04-11 15:56 [Bug ipa/100036] New: missed optimization for dead code elimination at -Os, -O2 and -O3 (vs. -O1) zhendong.su at inf dot ethz.ch
  2021-04-12  8:56 ` [Bug ipa/100036] " rguenth at gcc dot gnu.org
@ 2021-04-12  8:56 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-12  8:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100036

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-04-12

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-12  8:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-11 15:56 [Bug ipa/100036] New: missed optimization for dead code elimination at -Os, -O2 and -O3 (vs. -O1) zhendong.su at inf dot ethz.ch
2021-04-12  8:56 ` [Bug ipa/100036] " rguenth at gcc dot gnu.org
2021-04-12  8:56 ` rguenth at gcc dot gnu.org

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).