From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29912 invoked by alias); 22 Jun 2014 14:47:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 29900 invoked by uid 89); 22 Jun 2014 14:47:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ve0-f180.google.com Received: from mail-ve0-f180.google.com (HELO mail-ve0-f180.google.com) (209.85.128.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 22 Jun 2014 14:47:06 +0000 Received: by mail-ve0-f180.google.com with SMTP id jw12so5062961veb.25 for ; Sun, 22 Jun 2014 07:47:04 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.52.248.146 with SMTP id ym18mr11506280vdc.8.1403448424109; Sun, 22 Jun 2014 07:47:04 -0700 (PDT) Received: by 10.220.11.5 with HTTP; Sun, 22 Jun 2014 07:47:04 -0700 (PDT) In-Reply-To: <20140621024301.GE4551@kam.mff.cuni.cz> References: <20140621024301.GE4551@kam.mff.cuni.cz> Date: Sun, 22 Jun 2014 14:47:00 -0000 Message-ID: Subject: Re: Another AIX Bootstrap failure From: David Edelsohn To: Jan Hubicka Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-06/txt/msg01682.txt.bz2 The new testcases also declare main() as "void", but "return 0". - David On Fri, Jun 20, 2014 at 10:43 PM, Jan Hubicka wrote: > Index: testsuite/gcc.dg/localalias.c > =================================================================== > --- testsuite/gcc.dg/localalias.c (revision 0) > +++ testsuite/gcc.dg/localalias.c (revision 0) > @@ -0,0 +1,42 @@ > +/* This test checks that local aliases behave sanely. This is necessary for code correctness > + of aliases introduced by ipa-visibility pass. > + > + If this test fails either aliases needs to be disabled on given target on aliases with > + proper semantic needs to be implemented. This is problem with e.g. AIX .set pseudo-op > + that implementes alias syntactically (by substituting in assembler) rather as alternative > + symbol defined on a target's location. */ > + > +/* { dg-do run } > + { dg-options "-Wstrict-aliasing=2 -fstrict-aliasing" } > + { dg-require-alias "" } > + { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } > + { dg-additional-sources "localalias-2.c" } */ > +extern void abort (void); > +extern int test2count; > +int testcount; > +__attribute__ ((weak,noinline)) > +void test(void) > +{ > + testcount++; > +} > +__attribute ((alias("test"))) > +static void test2(void); > + > +void main() ^^^^^^^^^^^^^^^^^^^^^ > +{ > + test2(); > + /* This call must bind locally. */ > + if (!testcount) > + abort (); > + test(); > + /* Depending on linker choice, this one may bind locally > + or to the other unit. */ > + if (!testcount && !test2count) > + abort(); > + tt(); > + > + if ((testcount != 1 || test2count != 3) > + && (testcount != 3 || test2count != 1)) > + abort (); > + reutrn 0; ^^^^^^^^^^^^^^^^^^^^^^ > +} > Index: testsuite/gcc.dg/globalalias.c > =================================================================== > --- testsuite/gcc.dg/globalalias.c (revision 0) > +++ testsuite/gcc.dg/globalalias.c (revision 0) > @@ -0,0 +1,42 @@ > +/* This test checks that local aliases behave sanely. This is necessary for code correctness > + of aliases introduced by ipa-visibility pass. > + > + This test expose weird behaviour of AIX's .set pseudo-op where the global symbol is created, > + but all uses of the alias are syntactically replaced by uses of the target. This means that > + both counters are increased to 2. */ > + > +/* { dg-do run } > + { dg-options "-O2" } > + { dg-require-alias "" } > + { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } > + { dg-additional-sources "globalalias-2.c" } */ > +extern int test2count; > +extern void abort (void); > +int testcount; > +static > +void test(void) > +{ > + testcount++; > +} > +__attribute__ ((weak,noinline)) > +__attribute ((alias("test"))) > +void test2(void); > + > +void main() ^^^^^^^^^^^^^^^^^^^^^^^ > +{ > + test(); > + /* This call must bind locally. */ > + if (!testcount) > + abort (); > + test2(); > + /* Depending on linker choice, this one may bind locally > + or to the other unit. */ > + if (!testcount && !test2count) > + abort(); > + tt(); > + > + if ((testcount != 1 || test2count != 3) > + && (testcount != 3 || test2count != 1)) > + abort (); > + return 0; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > +} > Index: testsuite/gcc.dg/globalalias-2.c > =================================================================== > --- testsuite/gcc.dg/globalalias-2.c (revision 0) > +++ testsuite/gcc.dg/globalalias-2.c (revision 0) > @@ -0,0 +1,20 @@ > +int test2count; > +extern void abort (void); > +static > +void test(void) > +{ > + test2count++; > +} > +__attribute__ ((weak,noinline)) > +__attribute ((alias("test"))) > +void test2(void); > + > +void tt() > +{ > + int prev = test2count; > + /* This call must bind locally. */ > + test(); > + if (test2count == prev) > + abort(); > + test2(); > + } > Index: testsuite/gcc.dg/localalias-2.c > =================================================================== > --- testsuite/gcc.dg/localalias-2.c (revision 0) > +++ testsuite/gcc.dg/localalias-2.c (revision 0) > @@ -0,0 +1,19 @@ > +extern void abort (void); > +int test2count; > +__attribute__ ((weak,noinline)) > +void test(void) > +{ > + test2count++; > +} > +__attribute ((alias("test"))) > +static void test2(void); > + > +void tt() > +{ > + int prev = test2count; > + /* This call must bind locally. */ > + test2(); > + if (test2count == prev) > + abort(); > + test(); > + } > Index: ipa-visibility.c > =================================================================== > --- ipa-visibility.c (revision 211858) > +++ ipa-visibility.c (working copy) > @@ -566,7 +566,11 @@ function_and_variable_visibility (bool w > cheaper and enable more optimization. > > TODO: We can also update virtual tables. */ > - if (node->callers && can_replace_by_local_alias (node)) > + if (node->callers > + /* FIXME: currently this optimization breaks on AIX. Disable it for targets > + without comdat support for now. */ > + && SUPPORTS_ONE_ONLY > + && can_replace_by_local_alias (node)) > { > struct cgraph_node *alias = cgraph (symtab_nonoverwritable_alias (node)); >