public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tgard at opentext dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/60984] [4.9 Regression] AIX: gcc-4.9.0 bootstrap fails in stage-2
Date: Tue, 29 Apr 2014 14:11:00 -0000	[thread overview]
Message-ID: <bug-60984-4-UGL9cbAMdS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60984-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from Torbjörn Gard <tgard at opentext dot com> ---
I used gcc-4.8.2
>From gcc-bugs-return-450134-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 29 14:16:56 2014
Return-Path: <gcc-bugs-return-450134-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21247 invoked by alias); 29 Apr 2014 14:16:55 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 21189 invoked by uid 48); 29 Apr 2014 14:16:51 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/56888] memcpy implementation optimized as a call to memcpy
Date: Tue, 29 Apr 2014 14:16:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-56888-4-BONHctoF3h@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56888-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56888-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg02154.txt.bz2
Content-length: 2433

http://gcc.gnu.org/bugzilla/show_bug.cgi?idV888

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

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

--- Comment #27 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ok, so looking at this again.

We don't have a cgraph node for builtin_decl_(implicit|explicit)
(BUILT_IN_MEMSET).

But it seems that decl has DECL_ASSEMBLER_NAME_SET_P (not sure if set
"correctly" though).

So we can use symtab_node_for_asm (DECL_ASSEMBLER_NAME ()) and
eventually get to symtab_alias_target of that and check if it
is equal to the current function.

Index: gcc/tree-loop-distribution.c
==================================================================--- gcc/tree-loop-distribution.c        (revision 209892)
+++ gcc/tree-loop-distribution.c        (working copy)
@@ -71,6 +71,7 @@ along with GCC; see the file COPYING3.
 #include "tree-pass.h"
 #include "gimple-pretty-print.h"
 #include "tree-vectorizer.h"
+#include "cgraph.h"


 /* A Reduced Dependence Graph (RDG) vertex representing a statement.  */
@@ -1084,6 +1085,15 @@ classify_partition (loop_p loop, struct
          || !dominated_by_p (CDI_DOMINATORS,
                              loop->latch, gimple_bb (stmt)))
        return;
+      tree fn = builtin_decl_implicit (BUILT_IN_MEMSET);
+      if (DECL_ASSEMBLER_NAME_SET_P (fn))
+       {
+         symtab_node *n1 = symtab_node_for_asm (DECL_ASSEMBLER_NAME (fn));
+         symtab_node *n2 = symtab_get_node (cfun->decl);
+         if (n1 == n2
+             || (n1->alias && symtab_alias_target (n1) == n2))
+           return;
+       }
       partition->kind = PKIND_MEMSET;
       partition->main_dr = single_store;
       partition->niter = nb_iter;


fixes the following testcase:

typedef __SIZE_TYPE__ size_t;
extern void *
memset (void *s, int c, size_t n) __attribute__ ((weak, alias("_memset")));

void *
_memset(void *s, int c, size_t n)
{
  char *q = (char *)s;
  while (n != 0)
    {
      *(q++) = c;
      n--;
    }
}

it won't fix glibc as that uses

asm(".alias ....");

for the aliases which we don't parse.

It of course also fixes the very direct recursion.  At least if
the assembler name of the builtin agrees with that of the function.

Honza, is there a more "fancy" way of doing this?


  parent reply	other threads:[~2014-04-29 14:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28  9:05 [Bug bootstrap/60984] New: " tgard at opentext dot com
2014-04-28 13:46 ` [Bug bootstrap/60984] " dje at gcc dot gnu.org
2014-04-28 19:23 ` dje at gcc dot gnu.org
2014-04-28 19:41 ` dje at gcc dot gnu.org
2014-04-28 22:09 ` dje at gcc dot gnu.org
2014-04-29  7:49 ` jakub at gcc dot gnu.org
2014-04-29  7:55 ` [Bug bootstrap/60984] [4.9 Regression] " rguenth at gcc dot gnu.org
2014-04-29 12:54 ` dje at gcc dot gnu.org
2014-04-29 14:11 ` tgard at opentext dot com [this message]
2014-04-29 17:01 ` dje at gcc dot gnu.org
2014-04-29 17:56 ` dje at gcc dot gnu.org
2014-05-02  7:59 ` tgard at opentext dot com
2014-05-02 13:29 ` tgard at opentext dot com
2014-05-04 20:13 ` dje at gcc dot gnu.org
2014-05-05  7:18 ` tgard at opentext dot com
2014-05-05 15:25 ` tgard at opentext dot com
2014-05-08  1:18 ` dje at gcc dot gnu.org
2014-05-08  2:05 ` dje at gcc dot gnu.org
2014-05-08  3:00 ` dje at gcc dot gnu.org
2014-05-08 17:42 ` dje at gcc dot gnu.org
2014-05-09 14:29 ` hubicka at gcc dot gnu.org
2014-05-09 15:44 ` dje at gcc dot gnu.org
2014-05-09 15:53 ` dje at gcc dot gnu.org
2014-05-10 14:57 ` dje at gcc dot gnu.org
2014-05-10 15:34 ` dje at gcc dot gnu.org
2014-05-20 22:48 ` hubicka at ucw dot cz
2014-05-20 23:02 ` dje at gcc dot gnu.org
2014-05-20 23:23 ` hubicka at ucw dot cz
2014-05-21  1:45 ` dje at gcc dot gnu.org
2014-05-21  5:40 ` hubicka at gcc dot gnu.org
2014-05-21  5:42 ` hubicka at gcc dot gnu.org
2014-05-21  5:45 ` hubicka at gcc dot gnu.org
2014-05-22 12:11 ` tgard at opentext dot com
2014-05-22 21:06 ` fbissey at slingshot dot co.nz

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-60984-4-UGL9cbAMdS@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).