public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
       [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
@ 2010-09-30 17:28 ` rguenth at gcc dot gnu.org
  2010-11-04 11:16 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-09-30 17:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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

* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
       [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
  2010-09-30 17:28 ` [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto rguenth at gcc dot gnu.org
@ 2010-11-04 11:16 ` rguenth at gcc dot gnu.org
  2010-11-11 12:28 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-04 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.11.04 11:16:03
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-04 11:16:03 UTC ---
Confirmed.


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

* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
       [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
  2010-09-30 17:28 ` [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto rguenth at gcc dot gnu.org
  2010-11-04 11:16 ` rguenth at gcc dot gnu.org
@ 2010-11-11 12:28 ` rguenth at gcc dot gnu.org
  2010-11-11 14:16 ` hubicka at ucw dot cz
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-11 12:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-11 12:28:42 UTC ---
More complete testcase:

--- file1.c ----
void baz(void) {}
void *y = (void *)baz;
int main () { return 0; }

--- file2.c ----
static void bar(void) __attribute__ ((weakref("baz")));
void *x = (void *)bar;


which still ICEs with a trivial patch I had (that fixed the original one).

It shows that we somehow fail to mark baz as needed even though it is
referenced by y.  And of course we fail to mark it needed by the
alias as well.

One reason may be that we don't have a cgraph node for baz in file2.o
(nor do we have one if declaring baz).  OTOH when reading the cgraph
node for baz it shows that it is !needed which is obviously wrong.
ref_list of the cgraph node for baz is empty.  The ref_list for
y contains three times(!??):
 fn:baz/0 (addr) fn:baz/0 (addr) fn:baz/0 (addr)

then 2nd and 3rd come from

#5  0x0000000000d075f0 in cgraph_process_new_functions ()
    at /space/rguenther/src/svn/trunk/gcc/cgraphunit.c:219
219       varpool_analyze_pending_decls ();
(gdb) 
#6  0x00000000008fae86 in execute_one_pass (pass=0x1722900)
    at /space/rguenther/src/svn/trunk/gcc/passes.c:1596
1596        cgraph_process_new_functions ();

as somehow the decl stays in pending state?  It does because

Old value = (struct varpool_node *) 0x0
New value = (struct varpool_node *) 0x7ffff5cf8138
varpool_enqueue_needed_node (node=0x7ffff5cf8138)
    at /space/rguenther/src/svn/trunk/gcc/varpool.c:303
303       notice_global_symbol (node->decl);
(gdb) up
#1  0x0000000000d7367f in varpool_mark_needed_node (node=0x7ffff5cf8138)
    at /space/rguenther/src/svn/trunk/gcc/varpool.c:315
315         varpool_enqueue_needed_node (node);

re-queues it.  Why if it is already analyzed (and why did it become
!needed again?  Should varpool_analyze_pending_decls not re-analyze
analyzed nodes?)

These are, of course, just unrelated problems.

Still for some reason the cgraph node is not needed:

Breakpoint 1, fancy_abort (
    file=0x113abc8 "/space/rguenther/src/svn/trunk/gcc/ipa.c", line=783, 
    function=0x113ae20 "function_and_variable_visibility")
    at /space/rguenther/src/svn/trunk/gcc/diagnostic.c:881
881       internal_error ("in %s, at %s:%d", function, trim_filename (file),
line);
(gdb) up
#1  0x0000000000c82296 in function_and_variable_visibility (
    whole_program=0 '\000') at /space/rguenther/src/svn/trunk/gcc/ipa.c:782
warning: Source file is more recent than executable.
782               gcc_assert (node->needed);
(gdb) p node->ref_list
$11 = {references = 0x0, refering = 0x17739e0}
(gdb) p node->ref_list->refering
$12 = (VEC_ipa_ref_ptr_heap *) 0x17739e0
(gdb) p node->ref_list->refering->base.vec[0]->refering.varpool_node->needed
$13 = 1

but it has a referer that is needed.

Honza - please investigate this - I'm lost in the maze.


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

* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
       [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2010-11-11 12:28 ` rguenth at gcc dot gnu.org
@ 2010-11-11 14:16 ` hubicka at ucw dot cz
  2010-12-14 16:32 ` hubicka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hubicka at ucw dot cz @ 2010-11-11 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jan Hubicka <hubicka at ucw dot cz> 2010-11-11 14:16:07 UTC ---
Hi,
handling of weaks and weakrefs is indeed deeply broken with LTO.  I plan to
look into it after pushing more of the stuff
I don't want to get into mainline too late in stage3. That is the inliner bits
and -flto changes. Hopefully early next week
(I am flying during the weekend).

Honza


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

* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
       [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2010-11-11 14:16 ` hubicka at ucw dot cz
@ 2010-12-14 16:32 ` hubicka at gcc dot gnu.org
  2011-01-06 23:14 ` hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2010-12-14 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> 2010-12-14 16:32:39 UTC ---
mine.


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

* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
       [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2010-12-14 16:32 ` hubicka at gcc dot gnu.org
@ 2011-01-06 23:14 ` hubicka at gcc dot gnu.org
  2011-01-07 18:45 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-06 23:14 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |hubicka at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-06 22:26:42 UTC ---
Mine, testing patch.


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

* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
       [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-01-06 23:14 ` hubicka at gcc dot gnu.org
@ 2011-01-07 18:45 ` hubicka at gcc dot gnu.org
  2011-01-11 17:41 ` hubicka at gcc dot gnu.org
  2011-01-11 17:58 ` hubicka at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-07 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-07 18:43:49 UTC ---
path posted http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00375.html


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

* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
       [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2011-01-07 18:45 ` hubicka at gcc dot gnu.org
@ 2011-01-11 17:41 ` hubicka at gcc dot gnu.org
  2011-01-11 17:58 ` hubicka at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-11 17:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-11 17:29:57 UTC ---
Author: hubicka
Date: Tue Jan 11 17:29:52 2011
New Revision: 168666

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168666
Log:

    PR lto/45721
    PR lto/45375
    * tree.h (symbol_alias_set_t): Move typedef here from varasm.c
    (symbol_alias_set_destroy, symbol_alias_set_contains,
    propagate_aliases_backward): Declare.
    * lto-streamer-out.c (struct sets): New sturcture.
    (trivally_defined_alias): New function.
    (output_alias_pair_p): Rewrite.
    (output_unreferenced_globals): Fix output of alias pairs.
    (produce_symtab): Likewise.
    * ipa.c (function_and_variable_visibility): Set weak alias destination
    as needed in lto.
    * varasm.c (symbol_alias_set_t): Remove.
    (symbol_alias_set_destroy): Export.
    (propagate_aliases_forward, propagate_aliases_backward): New functions
    based on ...
    (compute_visible_aliases): ... this one; remove.
    (trivially_visible_alias): New
    (trivially_defined_alias): New.
    (remove_unreachable_alias_pairs): Rewrite.
    (finish_aliases_1): Reorganize code checking if alias is defined.
    * passes.c (rest_of_decl_compilation): Do not call assemble_alias when
    in LTO mode.

    * lto.c (partition_cgraph_node_p, partition_varpool_node_p): Weakrefs are
    not partitioned.

    * testsuite/gcc.dg/lto/pr45721_1.c: New file.
    * testsuite/gcc.dg/lto/pr45721_0.c: New file.

Added:
    trunk/gcc/testsuite/gcc.dg/lto/pr45721_0.c
    trunk/gcc/testsuite/gcc.dg/lto/pr45721_1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-streamer-out.c
    trunk/gcc/lto/ChangeLog
    trunk/gcc/lto/lto.c
    trunk/gcc/passes.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.h
    trunk/gcc/varasm.c


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

* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
       [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2011-01-11 17:41 ` hubicka at gcc dot gnu.org
@ 2011-01-11 17:58 ` hubicka at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-11 17:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

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

--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-11 17:41:07 UTC ---
Fixed.


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

* [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto
  2010-09-18 18:01 [Bug lto/45721] New: " zsojka at seznam dot cz
@ 2010-09-18 18:26 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-18 18:26 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org
           Keywords|                            |lto
   Target Milestone|---                         |4.6.0


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


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

end of thread, other threads:[~2011-01-11 17:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45721-4@http.gcc.gnu.org/bugzilla/>
2010-09-30 17:28 ` [Bug lto/45721] [4.6 Regression] ICE: in function_and_variable_visibility, at ipa.c:673 with -flto rguenth at gcc dot gnu.org
2010-11-04 11:16 ` rguenth at gcc dot gnu.org
2010-11-11 12:28 ` rguenth at gcc dot gnu.org
2010-11-11 14:16 ` hubicka at ucw dot cz
2010-12-14 16:32 ` hubicka at gcc dot gnu.org
2011-01-06 23:14 ` hubicka at gcc dot gnu.org
2011-01-07 18:45 ` hubicka at gcc dot gnu.org
2011-01-11 17:41 ` hubicka at gcc dot gnu.org
2011-01-11 17:58 ` hubicka at gcc dot gnu.org
2010-09-18 18:01 [Bug lto/45721] New: " zsojka at seznam dot cz
2010-09-18 18:26 ` [Bug lto/45721] " rguenth at gcc dot gnu dot 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).