public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
@ 2011-10-21 15:21 markus at trippelsdorf dot de
  2011-10-21 15:23 ` [Bug middle-end/50823] " markus at trippelsdorf dot de
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: markus at trippelsdorf dot de @ 2011-10-21 15:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

             Bug #: 50823
           Summary: [4.7 Regression] ICE in inline_small_functions, at
                    ipa-inline.c:1407
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: markus@trippelsdorf.de


Happens when one tries to build gcc with -O3:

x86_64-pc-linux-gnu-gcc -c -march=native -O3 -pipe -fuse-linker-plugin -DIN_GCC
-W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Wold-style-definition -Wc++-compat -DHAVE_CONFIG_H -I.
-I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include
-I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber ../../gcc/gcc/emit-rtl.c
-o emit-rtl.o
../../gcc/gcc/emit-rtl.c:5939:0: internal compiler error: in
inline_small_functions, at ipa-inline.c:1407

Reduced testcase is attached.

 % gcc -c -O3 -w test.i
test.i:79:1: internal compiler error: in inline_small_functions, at
ipa-inline.c:1407


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
@ 2011-10-21 15:23 ` markus at trippelsdorf dot de
  2011-10-21 16:11 ` markus at trippelsdorf dot de
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: markus at trippelsdorf dot de @ 2011-10-21 15:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

--- Comment #1 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2011-10-21 15:22:35 UTC ---
Created attachment 25571
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25571
testcase


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
  2011-10-21 15:23 ` [Bug middle-end/50823] " markus at trippelsdorf dot de
@ 2011-10-21 16:11 ` markus at trippelsdorf dot de
  2011-10-23 10:56 ` rguenth at gcc dot gnu.org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: markus at trippelsdorf dot de @ 2011-10-21 16:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

--- Comment #2 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2011-10-21 16:10:45 UTC ---
Caused by:

commit 60ac8a3c08cc653bc92507cb1be08ca2ebe6774a
Author: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Oct 20 11:46:08 2011 +0000

        PR bootstrap/50709
        * ipa-inline.c (inline_small_functions): Fix checking code to not make
        effect on fibheap stability.


    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180247
138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 204ab43..e7c42e5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-10-19  Jan Hubicka  <jh@suse.cz>
+
+       PR bootstrap/50709
+       * ipa-inline.c (inline_small_functions): Fix checking code to not make
+       effect on fibheap stability.
+
 2011-10-20  Maxim Kuvyrkov  <maxim@codesourcery.com>

        * config/m68k/t-linux (M68K_MLIB_CPU): Add ColdFire CPUs.
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index f069914..909b5ba 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1384,6 +1384,7 @@ inline_small_functions (void)
       struct cgraph_node *where, *callee;
       int badness = fibheap_min_key (heap);
       int current_badness;
+      int cached_badness;
       int growth;

       edge = (struct cgraph_edge *) fibheap_extract_min (heap);
@@ -1392,16 +1393,18 @@ inline_small_functions (void)
       if (!edge->inline_failed)
        continue;

-      /* Be sure that caches are maintained consistent.  */
-#ifdef ENABLE_CHECKING
+      /* Be sure that caches are maintained consistent.  
+         We can not make this ENABLE_CHECKING only because it cause differnt
+         updates of the fibheap queue.  */
+      cached_badness = edge_badness (edge, false);
       reset_edge_growth_cache (edge);
       reset_node_growth_cache (edge->callee);
-#endif

       /* When updating the edge costs, we only decrease badness in the keys.
         Increases of badness are handled lazilly; when we see key with out
         of date value on it, we re-insert it now.  */
       current_badness = edge_badness (edge, false);
+      gcc_assert (cached_badness == current_badness);
       gcc_assert (current_badness >= badness);
       if (current_badness != badness)
        {

The whole cached_badness thing looks pretty bogus to me.


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
  2011-10-21 15:23 ` [Bug middle-end/50823] " markus at trippelsdorf dot de
  2011-10-21 16:11 ` markus at trippelsdorf dot de
@ 2011-10-23 10:56 ` rguenth at gcc dot gnu.org
  2011-10-24 20:11 ` d.g.gorbachev at gmail dot com
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-23 10:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.0


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (2 preceding siblings ...)
  2011-10-23 10:56 ` rguenth at gcc dot gnu.org
@ 2011-10-24 20:11 ` d.g.gorbachev at gmail dot com
  2011-10-27 11:31 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-10-24 20:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

--- Comment #3 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2011-10-24 20:10:12 UTC ---
Created attachment 25598
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25598
Another testcase

Compile it with `gcc -O3 -flto -nostdlib -r foobar.c baz.c'.


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (3 preceding siblings ...)
  2011-10-24 20:11 ` d.g.gorbachev at gmail dot com
@ 2011-10-27 11:31 ` rguenth at gcc dot gnu.org
  2011-10-27 11:48 ` rguenth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 11:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-10-27
     Ever Confirmed|0                           |1

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-27 11:30:57 UTC ---
Confirmed.


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (4 preceding siblings ...)
  2011-10-27 11:31 ` rguenth at gcc dot gnu.org
@ 2011-10-27 11:48 ` rguenth at gcc dot gnu.org
  2011-10-27 11:54 ` rguenth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 11:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-27 11:45:55 UTC ---
*** Bug 50868 has been marked as a duplicate of this bug. ***


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (5 preceding siblings ...)
  2011-10-27 11:48 ` rguenth at gcc dot gnu.org
@ 2011-10-27 11:54 ` rguenth at gcc dot gnu.org
  2011-10-27 21:43 ` belyshev at depni dot sinp.msu.ru
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 11:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-27 11:53:23 UTC ---
*** Bug 50872 has been marked as a duplicate of this bug. ***


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (6 preceding siblings ...)
  2011-10-27 11:54 ` rguenth at gcc dot gnu.org
@ 2011-10-27 21:43 ` belyshev at depni dot sinp.msu.ru
  2011-10-30 12:43 ` dominiq at lps dot ens.fr
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: belyshev at depni dot sinp.msu.ru @ 2011-10-27 21:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

Serge Belyshev <belyshev at depni dot sinp.msu.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
                 CC|                            |belyshev at depni dot
                   |                            |sinp.msu.ru

--- Comment #7 from Serge Belyshev <belyshev at depni dot sinp.msu.ru> 2011-10-27 21:42:38 UTC ---
Slightly smaller testcase, fails with -O2 -finline-functions:

int k1, k2, k3, k4, k5, k6, k7, k8;

void set_first_insn (int);
void set_last_insn (void);

static int make_insn_raw (void) 
{
  set_first_insn (0);
  set_last_insn ();
  return k1;
}

static void add_insn_after (void)
{
  if (k2)
    k3 = k4;

  if (k5)
    k6 = k7;
}

void emit_pattern_after_noloc (int (make_raw) (void)) 
{
  if (k8)
    {
      make_raw ();
      add_insn_after ();
    }
}

void emit_insn_after_noloc (void)
{
  emit_pattern_after_noloc (make_insn_raw);
}

void emit_debug_insn_before_setloc (int k9)
{
  if (k9)
    make_insn_raw ();
}


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (7 preceding siblings ...)
  2011-10-27 21:43 ` belyshev at depni dot sinp.msu.ru
@ 2011-10-30 12:43 ` dominiq at lps dot ens.fr
  2011-11-05 11:51 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-10-30 12:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-10-30 12:41:34 UTC ---
I get the same ICE when compiling the polyhedron test aermod.f90:

[macbook] lin/test% gfc aermod.f90 -O3 --param max-inline-insns-auto=198
aermod.f90:39103:0: internal compiler error: in inline_small_functions, at
ipa-inline.c:1413
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[macbook] lin/test% gfc aermod.f90 -O3 --param max-inline-insns-auto=197
[macbook] lin/test%


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (8 preceding siblings ...)
  2011-10-30 12:43 ` dominiq at lps dot ens.fr
@ 2011-11-05 11:51 ` rguenth at gcc dot gnu.org
  2011-11-07 10:01 ` kirill.yukhin at intel dot com
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-05 11:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jojelino at gmail dot com

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-05 11:50:27 UTC ---
*** Bug 50995 has been marked as a duplicate of this bug. ***


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (9 preceding siblings ...)
  2011-11-05 11:51 ` rguenth at gcc dot gnu.org
@ 2011-11-07 10:01 ` kirill.yukhin at intel dot com
  2011-11-15 15:22 ` ohsumit at molbio dot mgh.harvard.edu
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: kirill.yukhin at intel dot com @ 2011-11-07 10:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

Yukhin Kirill <kirill.yukhin at intel dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kirill.yukhin at intel dot
                   |                            |com

--- Comment #10 from Yukhin Kirill <kirill.yukhin at intel dot com> 2011-11-07 09:59:07 UTC ---
Spec2000/176.gcc fails on peak with '-flto' option (actually this was mentioned
in #50868).

Here is the output:
gcc -static -flto     -O3 -funroll-loops -ffast-math  -DSPEC_CPU2000_LP64
c-parse.o c-lang.o c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o
c-aux-info.o c-common.o c-iterate.o toplev.o version.o tree.o print-tree.o
stor-layout.o fold-const.o function.o stmt.o expr.o calls.o expmed.o explow.o
optabs.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o real.o dbxout.o
sdbout.o dwarfout.o xcoffout.o integrate.o jump.o cse.o loop.o unroll.o flow.o
stupid.o combine.o regclass.o local-alloc.o global.o reload.o reload1.o
caller-save.o insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o
insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o
insn-attrtab.o m88k.o getpwd.o convert.o bc-emit.o bc-optab.o obstack.o   -lm 
-o cc1
...
lto1: internal compiler error: in inline_small_functions, at ipa-inline.c:1413
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: gcc returned 1 exit status
/usr/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status
specmake: *** [cc1] Error 1


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (10 preceding siblings ...)
  2011-11-07 10:01 ` kirill.yukhin at intel dot com
@ 2011-11-15 15:22 ` ohsumit at molbio dot mgh.harvard.edu
  2011-11-23 18:27 ` dnovillo at gcc dot gnu.org
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: ohsumit at molbio dot mgh.harvard.edu @ 2011-11-15 15:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

--- Comment #11 from Toshiro K. Ohsumi <ohsumit at molbio dot mgh.harvard.edu> 2011-11-15 15:13:04 UTC ---
When compiling an empty program, but with a large include with many templates,
I note that there is a failure at line 1421 on ipa-inline.c.  However, it seems
only to occur when -O2 or -O3 is set.  (Are these the only times inline
optimizations are performed?)  Unfortunately, I do not have a small test case. 
The includes come out to be about 2M in size.  

ohsumit@mothra:~> g++ --version
g++ (GCC) 4.7.0 20111115 (experimental)
Copyright (C) 2011 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.

ohsumit@mothra:~> g++ -Wall -DDEBUG -ggdb -O3 t1.cpp -o t1
t1.cpp:7:1: internal compiler error: in inline_small_functions, at
ipa-inline.c:1421
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
ohsumit@mothra:~> g++ -Wall -DDEBUG -ggdb -O2 t1.cpp -o t1
t1.cpp:7:1: internal compiler error: in inline_small_functions, at
ipa-inline.c:1421
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
ohsumit@mothra:~> g++ -Wall -DDEBUG -ggdb -O t1.cpp -o t1


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (11 preceding siblings ...)
  2011-11-15 15:22 ` ohsumit at molbio dot mgh.harvard.edu
@ 2011-11-23 18:27 ` dnovillo at gcc dot gnu.org
  2011-12-06 13:07 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: dnovillo at gcc dot gnu.org @ 2011-11-23 18:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

Diego Novillo <dnovillo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at gcc dot gnu.org

--- Comment #12 from Diego Novillo <dnovillo at gcc dot gnu.org> 2011-11-23 17:55:09 UTC ---
I am also seeing this failure building with -m32 -march=pentium4.  We fail the
assertion

+      gcc_assert (cached_badness == current_badness);

Sadly, it happens on a hairy large TU that I have not yet reduced.


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (12 preceding siblings ...)
  2011-11-23 18:27 ` dnovillo at gcc dot gnu.org
@ 2011-12-06 13:07 ` rguenth at gcc dot gnu.org
  2011-12-06 13:51 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 13:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

--- Comment #13 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 13:03:40 UTC ---
This fixes it:

Index: gcc/ipa-inline.c
===================================================================
--- gcc/ipa-inline.c    (revision 182044)
+++ gcc/ipa-inline.c    (working copy)
@@ -808,7 +808,6 @@ edge_badness (struct cgraph_edge *edge,
   else if (flag_guess_branch_prob)
     {
       int div = edge->frequency * (1<<10) / CGRAPH_FREQ_MAX;
-      int growth_for_all;

       div = MAX (div, 1);
       gcc_checking_assert (edge->frequency <= CGRAPH_FREQ_MAX);
@@ -846,14 +845,12 @@ edge_badness (struct cgraph_edge *edge,
          if (dump)
            fprintf (dump_file, "Badness overflow\n");
        }
-      growth_for_all = estimate_growth (callee);
-      badness += growth_for_all;
       if (dump)
        {
          fprintf (dump_file,
-                  "      %i: guessed profile. frequency %f, overall growth
%i,"
+                  "      %i: guessed profile. frequency %f,"
                   " benefit %f%%, divisor %i\n",
-                  (int) badness, (double)edge->frequency / CGRAPH_FREQ_BASE,
growth_for_all,
+                  (int) badness, (double)edge->frequency / CGRAPH_FREQ_BASE,
                   relative_time_benefit (callee_info, edge, time_growth) * 100
/ 256.0, div);
        }
     }

I'm going to bootstrap, test and apply this given that Honza seems to have
no interest in fixing his own regressions.  [and this particular patch
was on my agenda for quite some time]


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (13 preceding siblings ...)
  2011-12-06 13:07 ` rguenth at gcc dot gnu.org
@ 2011-12-06 13:51 ` rguenth at gcc dot gnu.org
  2011-12-07 11:56 ` rguenth at gcc dot gnu.org
  2011-12-07 12:26 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 13:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matt at use dot net

--- Comment #14 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 13:48:02 UTC ---
*** Bug 51263 has been marked as a duplicate of this bug. ***


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (14 preceding siblings ...)
  2011-12-06 13:51 ` rguenth at gcc dot gnu.org
@ 2011-12-07 11:56 ` rguenth at gcc dot gnu.org
  2011-12-07 12:26 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-07 11:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

--- Comment #15 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-07 11:55:19 UTC ---
Author: rguenth
Date: Wed Dec  7 11:55:16 2011
New Revision: 182077

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182077
Log:
2011-12-07  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/50823
    * ipa-inline.c (edge_badness): Do not account for the number of
    remaining calls.

    * gcc.dg/torture/pr50823.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr50823.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-inline.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug middle-end/50823] [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407
  2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
                   ` (15 preceding siblings ...)
  2011-12-07 11:56 ` rguenth at gcc dot gnu.org
@ 2011-12-07 12:26 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-07 12:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50823

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #16 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-07 12:23:38 UTC ---
Fixed.


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

end of thread, other threads:[~2011-12-07 12:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-21 15:21 [Bug middle-end/50823] New: [4.7 Regression] ICE in inline_small_functions, at ipa-inline.c:1407 markus at trippelsdorf dot de
2011-10-21 15:23 ` [Bug middle-end/50823] " markus at trippelsdorf dot de
2011-10-21 16:11 ` markus at trippelsdorf dot de
2011-10-23 10:56 ` rguenth at gcc dot gnu.org
2011-10-24 20:11 ` d.g.gorbachev at gmail dot com
2011-10-27 11:31 ` rguenth at gcc dot gnu.org
2011-10-27 11:48 ` rguenth at gcc dot gnu.org
2011-10-27 11:54 ` rguenth at gcc dot gnu.org
2011-10-27 21:43 ` belyshev at depni dot sinp.msu.ru
2011-10-30 12:43 ` dominiq at lps dot ens.fr
2011-11-05 11:51 ` rguenth at gcc dot gnu.org
2011-11-07 10:01 ` kirill.yukhin at intel dot com
2011-11-15 15:22 ` ohsumit at molbio dot mgh.harvard.edu
2011-11-23 18:27 ` dnovillo at gcc dot gnu.org
2011-12-06 13:07 ` rguenth at gcc dot gnu.org
2011-12-06 13:51 ` rguenth at gcc dot gnu.org
2011-12-07 11:56 ` rguenth at gcc dot gnu.org
2011-12-07 12:26 ` 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).