public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/60797] [4.9 Regression] gcc hangs with error: only weak aliases are supported in this configuration
Date: Fri, 11 Apr 2014 09:25:00 -0000	[thread overview]
Message-ID: <bug-60797-4-8o4vshb9Pa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60797-4@http.gcc.gnu.org/bugzilla/>

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


  parent reply	other threads:[~2014-04-11  9:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 19:31 [Bug c/60797] New: " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60797-4-8o4vshb9Pa@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).