public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60797] New: gcc hangs with error: only weak aliases are supported in this configuration
@ 2014-04-09 19:31 junchao.zhang at gmail dot com
  2014-04-09 19:44 ` [Bug c/60797] " dominiq at lps dot ens.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: junchao.zhang at gmail dot com @ 2014-04-09 19:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60797
           Summary: gcc hangs with error: only weak aliases are supported
                    in this configuration
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: junchao.zhang at gmail dot com

On my Mac OS X 10.9.2, when I use gcc to compile this program, test.c,

#include <stdio.h>

extern int foo __attribute__((alias("bar")));
int main()
{
    return 0;
}

gcc hangs with countless 
test.c:3:12: error: only weak aliases are supported in this configuration
test.c:3:12: error: only weak aliases are supported in this configuration
test.c:3:12: error: only weak aliases are supported in this configuration
...


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

* [Bug c/60797] gcc hangs with error: only weak aliases are supported in this configuration
  2014-04-09 19:31 [Bug c/60797] New: gcc hangs with error: only weak aliases are supported in this configuration junchao.zhang at gmail dot com
@ 2014-04-09 19:44 ` dominiq at lps dot ens.fr
  2014-04-11  9:11 ` [Bug middle-end/60797] [4.9 Regression] " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-04-09 19:44 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-04-09
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
r206658 gives

pr60797.c:3:12: error: only weak aliases are supported in this configuration
 extern int foo __attribute__((alias("bar")));
            ^
pr60797.c:3:12: error: only weak aliases are supported in this configuration

while r206880 gives the "infinite" errors.


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

* [Bug middle-end/60797] [4.9 Regression] gcc hangs with error: only weak aliases are supported in this configuration
  2014-04-09 19:31 [Bug c/60797] New: gcc hangs with error: only weak aliases are supported in this configuration junchao.zhang at gmail dot com
  2014-04-09 19:44 ` [Bug c/60797] " dominiq at lps dot ens.fr
@ 2014-04-11  9:11 ` rguenth at gcc dot gnu.org
  2014-04-11  9:25 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-11  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-darwin
                 CC|                            |hubicka at gcc dot gnu.org
   Target Milestone|---                         |4.9.0
            Summary|gcc hangs with error: only  |[4.9 Regression] gcc hangs
                   |weak aliases are supported  |with error: only weak
                   |in this configuration       |aliases are supported in
                   |                            |this configuration


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

* [Bug middle-end/60797] [4.9 Regression] gcc hangs with error: only weak aliases are supported in this configuration
  2014-04-09 19:31 [Bug c/60797] New: gcc hangs with error: only weak aliases are supported in this configuration junchao.zhang at gmail dot com
  2014-04-09 19:44 ` [Bug c/60797] " dominiq at lps dot ens.fr
  2014-04-11  9:11 ` [Bug middle-end/60797] [4.9 Regression] " rguenth at gcc dot gnu.org
@ 2014-04-11  9:25 ` rguenth at gcc dot gnu.org
  2014-04-11  9:30 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-11  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
0x0000000000615b12 in c_write_global_declarations_1 (
    globals=<type_decl 0x7ffff6c4d170 int>)
    at /space/rguenther/src/svn/trunk/gcc/c/c-decl.c:10276
10272     do
10273       {
10274         reconsider = false;
10275         for (decl = globals; decl; decl = DECL_CHAIN (decl))
10276           reconsider |= wrapup_global_declaration_2 (decl);
10277       }
10278     while (reconsider);

which basically endlessly loops because nothing sets TREE_ASM_WRITTEN on
the alias.

Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c        (revision 209292)
+++ gcc/varasm.c        (working copy)
@@ -5675,6 +5675,7 @@ assemble_alias (tree decl, tree target)
          else
            error_at (DECL_SOURCE_LOCATION (decl),
                      "only weak aliases are supported in this configuration");
+         TREE_ASM_WRITTEN (decl) = 1;
          return;
        }
 # endif

fixes it.  Probably also needed above for targets without any alias support.
I wonder why "weakref" errors just fall through and don't return though.

Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c        (revision 209292)
+++ gcc/varasm.c        (working copy)
@@ -5665,6 +5665,7 @@ assemble_alias (tree decl, tree target)
 # if !defined(ASM_OUTPUT_WEAK_ALIAS) && !defined (ASM_WEAKEN_DECL)
       error_at (DECL_SOURCE_LOCATION (decl),
                "alias definitions not supported in this configuration");
+      TREE_ASM_WRITTEN (decl) = 1;
       return;
 # else
       if (!DECL_WEAK (decl))
@@ -5675,6 +5676,7 @@ assemble_alias (tree decl, tree target)
          else
            error_at (DECL_SOURCE_LOCATION (decl),
                      "only weak aliases are supported in this configuration");
+         TREE_ASM_WRITTEN (decl) = 1;
          return;
        }
 # endif


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

* [Bug middle-end/60797] [4.9 Regression] gcc hangs with error: only weak aliases are supported in this configuration
  2014-04-09 19:31 [Bug c/60797] New: gcc hangs with error: only weak aliases are supported in this configuration junchao.zhang at gmail dot com
                   ` (2 preceding siblings ...)
  2014-04-11  9:25 ` rguenth at gcc dot gnu.org
@ 2014-04-11  9:30 ` rguenth at gcc dot gnu.org
  2014-04-11 11:46 ` rguenth at gcc dot gnu.org
  2014-04-11 11:46 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-11  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Testcase:

/* { dg-do compile } */
/* { dg-skip-if "" { alias } } */

extern int foo __attribute__((alias("bar"))); /* { dg-error "supported" } */
int main()
{
  return 0;
}


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

* [Bug middle-end/60797] [4.9 Regression] gcc hangs with error: only weak aliases are supported in this configuration
  2014-04-09 19:31 [Bug c/60797] New: gcc hangs with error: only weak aliases are supported in this configuration junchao.zhang at gmail dot com
                   ` (4 preceding siblings ...)
  2014-04-11 11:46 ` rguenth at gcc dot gnu.org
@ 2014-04-11 11:46 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-11 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Fri Apr 11 11:45:44 2014
New Revision: 209299

URL: http://gcc.gnu.org/viewcvs?rev=209299&root=gcc&view=rev
Log:
2014-04-11  Richard Biener  <rguenther@suse.de>

    PR middle-end/60797
    * varasm.c (assemble_alias): Avoid endless error reporting
    recursion by setting TREE_ASM_WRITTEN.

    * gcc.dg/pr60797.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/pr60797.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/varasm.c


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

* [Bug middle-end/60797] [4.9 Regression] gcc hangs with error: only weak aliases are supported in this configuration
  2014-04-09 19:31 [Bug c/60797] New: gcc hangs with error: only weak aliases are supported in this configuration junchao.zhang at gmail dot com
                   ` (3 preceding siblings ...)
  2014-04-11  9:30 ` rguenth at gcc dot gnu.org
@ 2014-04-11 11:46 ` rguenth at gcc dot gnu.org
  2014-04-11 11:46 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-11 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-04-11 11:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-09 19:31 [Bug c/60797] New: gcc hangs with error: only weak aliases are supported in this configuration junchao.zhang at gmail dot com
2014-04-09 19:44 ` [Bug c/60797] " dominiq at lps dot ens.fr
2014-04-11  9:11 ` [Bug middle-end/60797] [4.9 Regression] " rguenth at gcc dot gnu.org
2014-04-11  9:25 ` rguenth at gcc dot gnu.org
2014-04-11  9:30 ` rguenth at gcc dot gnu.org
2014-04-11 11:46 ` rguenth at gcc dot gnu.org
2014-04-11 11:46 ` 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).