public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875
@ 2011-03-09 12:13 rguenth at gcc dot gnu.org
  2011-03-09 12:28 ` [Bug middle-end/48044] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-09 12:13 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.6 Regression] ICE in
                    function_and_variable_visibility, at ipa.c:875
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
            Target: ia64-*-linux


Created attachment 23595
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23595
testcase

Building uClibc on ia64 ICEs.

/usr/lib/gcc/ia64-suse-linux/4.6/cc1 -fpreprocessed errno.i -quiet -dumpbase
errno.c -auxbase-strip libc/misc/internals/errno.os -g3 -O0 -Wall
-Wstrict-prototypes -Wnested-externs -Wshadow -Wmissing-noreturn
-Wmissing-format-attribute -Wformat=2 -Wmissing-prototypes
-Wmissing-declarations -Wnonnull -Wundef -std=gnu99 -version
-fno-strict-aliasing -fstack-protector -fno-builtin -fno-asm -fPIC -o errno.s
GNU C (SUSE Linux) version 4.6.0 20110308 [trunk revision 170774]
(ia64-suse-linux)
        compiled by GNU C version 4.6.0 20110308 [trunk revision 170774], GMP
version 5.0.1, MPFR version 3.0.0-p3, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C (SUSE Linux) version 4.6.0 20110308 [trunk revision 170774]
(ia64-suse-linux)
        compiled by GNU C version 4.6.0 20110308 [trunk revision 170774], GMP
version 5.0.1, MPFR version 3.0.0-p3, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: d99dab1301ec0970f4d6fd131beca4b3
libc/misc/internals/errno.c:14:1: internal compiler error: in
function_and_variable_visibility, at ipa.c:875
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.


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

* [Bug middle-end/48044] [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875
  2011-03-09 12:13 [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875 rguenth at gcc dot gnu.org
@ 2011-03-09 12:28 ` rguenth at gcc dot gnu.org
  2011-03-10  9:03 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-09 12:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|ia64-*-linux                |ia64-*-linux,
                   |                            |x86_64-*-linux
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.03.09 12:28:26
                 CC|                            |hubicka at gcc dot gnu.org
      Known to work|                            |4.5.2
   Target Milestone|---                         |4.6.0
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-09 12:28:26 UTC ---
Reduced testcase:

extern int errno;
extern __typeof (errno) errno __asm__ ("__GI_errno");
int errno = 0;
extern __typeof (errno) __EI_errno __asm__("errno");
extern __typeof (errno) __EI_errno __attribute__((alias ("__GI_errno")));
extern __typeof (errno) _errno __attribute__ ((weak, alias ("errno")));

fails with a cross to ia64-linux and also on x86_64-*-*.

gcc> ./cc1 -quiet errno.3.i 
errno.3.i:6:1: internal compiler error: in function_and_variable_visibility, at
ipa.c:875
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

works with -O1 and 4.5.2.


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

* [Bug middle-end/48044] [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875
  2011-03-09 12:13 [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875 rguenth at gcc dot gnu.org
  2011-03-09 12:28 ` [Bug middle-end/48044] " rguenth at gcc dot gnu.org
@ 2011-03-10  9:03 ` jakub at gcc dot gnu.org
  2011-03-10  9:36 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-10  9:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-10 09:02:51 UTC ---
Shorter testcase:
int a __asm__ ("b") = 0;
extern int c __asm__ ("a") __attribute__ ((alias ("b")));
extern int d __attribute__ ((weak, alias ("a")));


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

* [Bug middle-end/48044] [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875
  2011-03-09 12:13 [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875 rguenth at gcc dot gnu.org
  2011-03-09 12:28 ` [Bug middle-end/48044] " rguenth at gcc dot gnu.org
  2011-03-10  9:03 ` jakub at gcc dot gnu.org
@ 2011-03-10  9:36 ` jakub at gcc dot gnu.org
  2011-03-10 12:51 ` hubicka at ucw dot cz
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-10  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-10 09:36:12 UTC ---
c's vnode is first varpool_mark_needed_node, then it is again marked as not
needed by cgraph_remove_unreachable_nodes (so far both for -O0 and -O1+)
and as nothing like finish_aliases_1 is run afterwards again, the vnode is
!vnode->needed && vnode->force_output.  In -O1 case the varpool node is removed
altogether as not needed (which is strange, the vnode's decl is going to be
emitted anyway), but for -O0:
  /* We must release unused extern inlines or sanity checking will fail.  Rest
of transformations
     are undesirable at -O0 since we do not want to remove anything.  */
  if (!optimize)
    return changed;

  if (file)
    fprintf (file, "Reclaiming variables:");

the reclaiming isn't done, so the vnode remains !vnode->needed and we ICE on it
later on.

I wonder if cgraph_remove_unreachable_nodes shouldn't be somehow alias pairs
aware (can it e.g. call find_aliases_1 again?), or at least for !optimize
shouldn't it avoid clearing vnode->needed for vnode->force_output?


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

* [Bug middle-end/48044] [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875
  2011-03-09 12:13 [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875 rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-03-10  9:36 ` jakub at gcc dot gnu.org
@ 2011-03-10 12:51 ` hubicka at ucw dot cz
  2011-03-11 13:45 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hubicka at ucw dot cz @ 2011-03-10 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jan Hubicka <hubicka at ucw dot cz> 2011-03-10 12:51:19 UTC ---
> I wonder if cgraph_remove_unreachable_nodes shouldn't be somehow alias pairs
> aware (can it e.g. call find_aliases_1 again?), or at least for !optimize
> shouldn't it avoid clearing vnode->needed for vnode->force_output?

I guess the second (probably even when optimizing).  The idea of alias pair
handling in current cgraph is to pretend they do not exist and have the code
in visibility pass marking them force_output and thus disabling much of
optimization
around them.

For 4.7 we need to rewrite this in favour of proper symbol table that is quite
some
effort to do ;(

I will look into this today.
Honza


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

* [Bug middle-end/48044] [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875
  2011-03-09 12:13 [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875 rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-03-10 12:51 ` hubicka at ucw dot cz
@ 2011-03-11 13:45 ` jakub at gcc dot gnu.org
  2011-03-11 14:46 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-11 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-11 13:45:00 UTC ---
Created attachment 23628
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23628
gcc46-pr48044.patch

This fixed it and passed bootstrap/regtest.


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

* [Bug middle-end/48044] [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875
  2011-03-09 12:13 [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875 rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-03-11 13:45 ` jakub at gcc dot gnu.org
@ 2011-03-11 14:46 ` jakub at gcc dot gnu.org
  2011-03-11 14:47 ` jakub at gcc dot gnu.org
  2011-03-11 14:52 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-11 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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


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

* [Bug middle-end/48044] [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875
  2011-03-09 12:13 [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875 rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-03-11 14:46 ` jakub at gcc dot gnu.org
@ 2011-03-11 14:47 ` jakub at gcc dot gnu.org
  2011-03-11 14:52 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-11 14:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-11 14:47:29 UTC ---
Author: jakub
Date: Fri Mar 11 14:47:26 2011
New Revision: 170873

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170873
Log:
    PR middle-end/48044
    * ipa.c (cgraph_remove_unreachable_nodes): Enqueue
    all vnode->force_output nodes as needed.

    * gcc.dg/torture/pr48044.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr48044.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug middle-end/48044] [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875
  2011-03-09 12:13 [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875 rguenth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-03-11 14:47 ` jakub at gcc dot gnu.org
@ 2011-03-11 14:52 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-11 14:52 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-11 14:52:27 UTC ---
Fixed.


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

end of thread, other threads:[~2011-03-11 14:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-09 12:13 [Bug middle-end/48044] New: [4.6 Regression] ICE in function_and_variable_visibility, at ipa.c:875 rguenth at gcc dot gnu.org
2011-03-09 12:28 ` [Bug middle-end/48044] " rguenth at gcc dot gnu.org
2011-03-10  9:03 ` jakub at gcc dot gnu.org
2011-03-10  9:36 ` jakub at gcc dot gnu.org
2011-03-10 12:51 ` hubicka at ucw dot cz
2011-03-11 13:45 ` jakub at gcc dot gnu.org
2011-03-11 14:46 ` jakub at gcc dot gnu.org
2011-03-11 14:47 ` jakub at gcc dot gnu.org
2011-03-11 14:52 ` jakub 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).