public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61012] New: lto1: errors during merging of translation units (error: variable ‘link’ redeclared as function)
@ 2014-04-30 11:19 mliska at suse dot cz
  2014-05-21 16:44 ` [Bug lto/61012] [4.9/4.10 Regression] " hubicka at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mliska at suse dot cz @ 2014-04-30 11:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61012
           Summary: lto1: errors during merging of translation units
                    (error: variable ‘link’ redeclared as function)
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mliska at suse dot cz

$ cat a.c
struct s
{
  int a;
  int b;
};

static struct s link = { 1, 2 };

int foo()
{
  return link.a;
}

$ cat b.c
#include <unistd.h>

int main()
{
  int r = link("aaa", "bbb");

  return foo();
}

$ gcc a.c b.c -flto -O2

/usr/include/unistd.h:812:12: error: variable ‘link’ redeclared as function
 extern int link (const char *__from, const char *__to)
            ^
a.c:7:17: note: previously declared here
 static struct s link = { 1, 2 };
                 ^
lto1: fatal error: errors during merging of translation units
compilation terminated.
lto-wrapper: gcc returned 1 exit status
/home/marxin/Programming/bin/gcc2/lib64/gcc/x86_64-unknown-linux-gnu/4.10.0/../../../../x86_64-unknown-linux-gnu/bin/ld:
fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
>From gcc-bugs-return-450229-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Apr 30 11:23:58 2014
Return-Path: <gcc-bugs-return-450229-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18813 invoked by alias); 30 Apr 2014 11:23:57 -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 18778 invoked by uid 55); 30 Apr 2014 11:23:54 -0000
From: "mircea.namolaru at inria dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/61000] No loop interchange for inner loop along the slow index
Date: Wed, 30 Apr 2014 11:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mircea.namolaru at inria dot fr
X-Bugzilla-Status: UNCONFIRMED
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:
Message-ID: <bug-61000-4-wE1LHZv3KI@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61000-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61000-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/msg02249.txt.bz2
Content-length: 1743

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

--- Comment #4 from Mircea Namolaru <mircea.namolaru at inria dot fr> ---
Right, C arrays expressed as pointers suffers from the same problem.
But for C at least there is a way to avoid this.

Many thanks for your suggestion of how to de-linearize arrays in middle-end, it
seems that may be simpler then I've thought. Hope to find time and wrote a
patch
based on your idea for GCC 4.10.

Mircea

----- Original Message -----
> From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
> To: "mircea namolaru" <mircea.namolaru@inria.fr>
> Sent: Wednesday, April 30, 2014 1:02:10 PM
> Subject: [Bug tree-optimization/61000] No loop interchange for inner loop along the slow index
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?ida000
>
> --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
> (In reply to Mircea Namolaru from comment #2)
> > Again, the problem is due to representation of arrays in Fortran as array
> > with a single dimnesion (for similar code in C profitability check work as
> > expected). It is a recurring problem that may lead to compilation time
> > increase (sometimes dramatically) or missed opportunities optimizations due
> > to too conservative dependence analysis or as on this case the
> > profitability
> > check failure. The solution is to de-liniarize array accesses in Fortran as
> > in C.
>
> Note that C doesn't always have de-linearized arrays (once you access the
> array via a pointer).
>
> For Fortran de-linearizing is "easy" via simple casting to a
> multi-dimensional
> (variable-bounds) array type.  For the middle-end side, that is.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
>


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

end of thread, other threads:[~2014-06-17  9:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30 11:19 [Bug c++/61012] New: lto1: errors during merging of translation units (error: variable ‘link’ redeclared as function) mliska at suse dot cz
2014-05-21 16:44 ` [Bug lto/61012] [4.9/4.10 Regression] " hubicka at gcc dot gnu.org
2014-05-22  5:36 ` hubicka at gcc dot gnu.org
2014-05-22  5:38 ` hubicka at gcc dot gnu.org
2014-05-22  5:41 ` hubicka at gcc dot gnu.org
2014-06-17  9:00 ` rguenth at gcc dot gnu.org
2014-06-17  9:08 ` rguenth at gcc dot gnu.org
2014-06-17  9:08 ` 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).