public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57294] New: ice in remove_described_reference
@ 2013-05-15 16:17 dcb314 at hotmail dot com
  2013-05-15 19:57 ` [Bug tree-optimization/57294] [4.9 Regression] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dcb314 at hotmail dot com @ 2013-05-15 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57294
           Summary: ice in remove_described_reference
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

Created attachment 30123
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30123&action=edit
C source code

I just tried to compile the package plymouth-0.8.9-0.2013.03.26.0
on gcc-4.9 trunk dated 20130515 on an AMD x86_64 box.

The compiler said

./script-execute.c: At top level:
./script-execute.c:785:1: internal compiler error: in
remove_described_reference, at ipa-prop.c:2296
 }
 ^
0x7b9afa remove_described_reference
    ../../src/trunk/gcc/ipa-prop.c:2296
0x7bda6b try_make_edge_direct_simple_call
    ../../src/trunk/gcc/ipa-prop.c:2347
0x7bda6b update_indirect_edges_after_inlining
    ../../src/trunk/gcc/ipa-prop.c:2441
0x7bda6b propagate_info_to_inlined_callees
    ../../src/trunk/gcc/ipa-prop.c:2500
0x7bdf9c ipa_propagate_indirect_call_infos(cgraph_edge*, vec<cgraph_edge*,
va_heap, vl_ptr>*)
    ../../src/trunk/gcc/ipa-prop.c:2660
0xd5cccc inline_call(cgraph_edge*, bool, vec<cgraph_edge*, va_heap, vl_ptr>*,
int*, bool)
    ../../src/trunk/gcc/ipa-inline-transform.c:255
0xd5bef5 inline_small_functions
    ../../src/trunk/gcc/ipa-inline.c:1613
0xd5bef5 ipa_inline
    ../../src/trunk/gcc/ipa-inline.c:1794
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Preprocessed source code attached. Flag -O3 required.


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

* [Bug tree-optimization/57294] [4.9 Regression] ice in remove_described_reference
  2013-05-15 16:17 [Bug c/57294] New: ice in remove_described_reference dcb314 at hotmail dot com
@ 2013-05-15 19:57 ` mpolacek at gcc dot gnu.org
  2013-05-16  8:47 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-05-15 19:57 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjambor at suse dot cz

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with http://gcc.gnu.org/r198821


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

* [Bug tree-optimization/57294] [4.9 Regression] ice in remove_described_reference
  2013-05-15 16:17 [Bug c/57294] New: ice in remove_described_reference dcb314 at hotmail dot com
  2013-05-15 19:57 ` [Bug tree-optimization/57294] [4.9 Regression] " mpolacek at gcc dot gnu.org
@ 2013-05-16  8:47 ` mpolacek at gcc dot gnu.org
  2013-05-16 14:05 ` jamborm at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-05-16  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
void baz (void);
int func ();

static void
bar (int a, int foo (void))
{
  baz ();
  foo ();
}

void
baz (void)
{
  bar (0, func);
}


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

* [Bug tree-optimization/57294] [4.9 Regression] ice in remove_described_reference
  2013-05-15 16:17 [Bug c/57294] New: ice in remove_described_reference dcb314 at hotmail dot com
  2013-05-15 19:57 ` [Bug tree-optimization/57294] [4.9 Regression] " mpolacek at gcc dot gnu.org
  2013-05-16  8:47 ` mpolacek at gcc dot gnu.org
@ 2013-05-16 14:05 ` jamborm at gcc dot gnu.org
  2013-05-17 16:53 ` jamborm at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-05-16 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |jamborm at gcc dot gnu.org

--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> ---
We do not have a reference recorded from bar.isra.0 to func and then
abort when we try to remove it.  It's most probably a failure of
cgraph_function_versioning during IPA-SRA because -fno-ipa-sra helps.

I'll have a look at it myself but perhaps Honza will know where to
look more quickly.


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

* [Bug tree-optimization/57294] [4.9 Regression] ice in remove_described_reference
  2013-05-15 16:17 [Bug c/57294] New: ice in remove_described_reference dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2013-05-16 14:05 ` jamborm at gcc dot gnu.org
@ 2013-05-17 16:53 ` jamborm at gcc dot gnu.org
  2013-05-17 22:12 ` hubicka at ucw dot cz
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-05-17 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jamborm at gcc dot gnu.org

--- Comment #5 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Actually, the interactions are a bit more convoluted, what happens is
the following:

  1. Early passes are run on function baz, references are computed for
     that function.

  2. Early passes are run on function bar.  IPA-SRA triggers and
     changes the call statement in function baz.  This means that the
     recorded pointer to the statement in the symbol table is stale.

  3. During inlining we ask ipa_find_reference to find the reference
     corresponding to the correct statement and of course do not get
     anything, which triggers an assert.

I've confirmed this is the case by putting a call to
cgraph_rebuild_references into convert_callers_for_node and it "fixes"
the issue.  But of course that could be quite expensive.

I'll revisit my efforts to remove IPA-SRA completely, this is another
piece of motivation but I am not entirely sure what to do about this
in the short term.  Probably update references in IPA-SRA.


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

* [Bug tree-optimization/57294] [4.9 Regression] ice in remove_described_reference
  2013-05-15 16:17 [Bug c/57294] New: ice in remove_described_reference dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2013-05-17 16:53 ` jamborm at gcc dot gnu.org
@ 2013-05-17 22:12 ` hubicka at ucw dot cz
  2013-05-24 15:27 ` jamborm at gcc dot gnu.org
  2013-05-24 15:37 ` jamborm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at ucw dot cz @ 2013-05-17 22:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jan Hubicka <hubicka at ucw dot cz> ---
> I've confirmed this is the case by putting a call to
> cgraph_rebuild_references into convert_callers_for_node and it "fixes"
> the issue.  But of course that could be quite expensive.

Hmm, it is bit ugly to keep not-up-to-date data around at first place.
But perhaps the whole tracking  should be simply disabled for early inlining?

Honza


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

* [Bug tree-optimization/57294] [4.9 Regression] ice in remove_described_reference
  2013-05-15 16:17 [Bug c/57294] New: ice in remove_described_reference dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2013-05-17 22:12 ` hubicka at ucw dot cz
@ 2013-05-24 15:27 ` jamborm at gcc dot gnu.org
  2013-05-24 15:37 ` jamborm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-05-24 15:27 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2013-05/msg01507.htm
                   |                            |l

--- Comment #7 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Proposed patch submitted to the mailing list:
http://gcc.gnu.org/ml/gcc-patches/2013-05/msg01507.html


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

* [Bug tree-optimization/57294] [4.9 Regression] ice in remove_described_reference
  2013-05-15 16:17 [Bug c/57294] New: ice in remove_described_reference dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2013-05-24 15:27 ` jamborm at gcc dot gnu.org
@ 2013-05-24 15:37 ` jamborm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-05-24 15:37 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

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

--- Comment #8 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Author: jamborm
Date: Fri May 24 15:35:21 2013
New Revision: 199299

URL: http://gcc.gnu.org/viewcvs?rev=199299&root=gcc&view=rev
Log:
2013-05-24  Martin Jambor  <mjambor@suse.cz>

    PR tree-optimization/57294
    * cgraph.h (ipa_record_stmt_references): Declare.
    * cgraphbuild.c (ipa_record_stmt_references): New function.
    (build_cgraph_edges): Use ipa_record_stmt_references.
    (rebuild_cgraph_edges): Likewise.
    (cgraph_rebuild_references): Likewise.
    * ipa-prop.c (ipa_modify_call_arguments): Discard references
    associated with the old statement and build references from the
    newly built statements.
    * ipa-ref.c (ipa_remove_stmt_references): New function.
    * ipa-ref.h (ipa_remove_stmt_references): Declare.

testsuite/
    * gcc.dg/ipa/pr57294.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/ipa/pr57294.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cgraph.h
    trunk/gcc/cgraphbuild.c
    trunk/gcc/ipa-prop.c
    trunk/gcc/ipa-ref.c
    trunk/gcc/ipa-ref.h
    trunk/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2013-05-24 15:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-15 16:17 [Bug c/57294] New: ice in remove_described_reference dcb314 at hotmail dot com
2013-05-15 19:57 ` [Bug tree-optimization/57294] [4.9 Regression] " mpolacek at gcc dot gnu.org
2013-05-16  8:47 ` mpolacek at gcc dot gnu.org
2013-05-16 14:05 ` jamborm at gcc dot gnu.org
2013-05-17 16:53 ` jamborm at gcc dot gnu.org
2013-05-17 22:12 ` hubicka at ucw dot cz
2013-05-24 15:27 ` jamborm at gcc dot gnu.org
2013-05-24 15:37 ` jamborm 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).