Bug 37202 - FAIL: gcc.dg/visibility-1[4-9].c
Summary: FAIL: gcc.dg/visibility-1[4-9].c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-22 15:16 UTC by Dominique d'Humieres
Modified: 2008-12-27 05:46 UTC (History)
4 users (show)

See Also:
Host:
Target: *-apple-darwin*, avr-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-08-29 03:46:01


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique d'Humieres 2008-08-22 15:16:26 UTC
On *-apple-darwin* the following tests introduced at revision 139100:

Revision 139100 - (view) (download) - [select for diffs] 
Added Thu Aug 14 16:05:36 2008 UTC (7 days, 23 hours ago) by espindola 
File length: 239 byte(s)
2008-08-14  Rafael Avila de Espindola  <espindola@google.com>

	* gcc.dg/visibility-14.c: New test.
	* gcc.dg/visibility-15.c: New test.
	* gcc.dg/visibility-16.c: New test.
	* gcc.dg/visibility-17.c: New test.
	* gcc.dg/visibility-18.c: New test.
	* gcc.dg/visibility-19.c: New test.

fail since at least revision 139117 (see http://gcc.gnu.org/ml/gcc-testresults/2008-08/msg01430.html):

FAIL: gcc.dg/visibility-14.c scan-hidden private_extern[ \\t_]*_?foo
FAIL: gcc.dg/visibility-15.c scan-hidden private_extern[ \\t_]*_?foo
FAIL: gcc.dg/visibility-16.c scan-hidden private_extern[ \\t_]*_?foo
FAIL: gcc.dg/visibility-17.c scan-hidden private_extern[ \\t_]*_?foo
FAIL: gcc.dg/visibility-18.c scan-hidden private_extern[ \\t_]*_?foo
FAIL: gcc.dg/visibility-19.c scan-hidden private_extern[ \\t_]*_?foo
Comment 1 Rafael Avila de Espindola 2008-08-22 15:46:30 UTC
Subject: Re:  New: FAIL: gcc.dg/visibility-1[4-9].c

This is a duplicate of 37170

2008/8/22 dominiq at lps dot ens dot fr <gcc-bugzilla@gcc.gnu.org>:
> On *-apple-darwin* the following tests introduced at revision 139100:
>
> Revision 139100 - (view) (download) - [select for diffs]
> Added Thu Aug 14 16:05:36 2008 UTC (7 days, 23 hours ago) by espindola
> File length: 239 byte(s)
> 2008-08-14  Rafael Avila de Espindola  <espindola@google.com>
>
>        * gcc.dg/visibility-14.c: New test.
>        * gcc.dg/visibility-15.c: New test.
>        * gcc.dg/visibility-16.c: New test.
>        * gcc.dg/visibility-17.c: New test.
>        * gcc.dg/visibility-18.c: New test.
>        * gcc.dg/visibility-19.c: New test.
>
> fail since at least revision 139117 (see
> http://gcc.gnu.org/ml/gcc-testresults/2008-08/msg01430.html):
>
> FAIL: gcc.dg/visibility-14.c scan-hidden private_extern[ \\t_]*_?foo
> FAIL: gcc.dg/visibility-15.c scan-hidden private_extern[ \\t_]*_?foo
> FAIL: gcc.dg/visibility-16.c scan-hidden private_extern[ \\t_]*_?foo
> FAIL: gcc.dg/visibility-17.c scan-hidden private_extern[ \\t_]*_?foo
> FAIL: gcc.dg/visibility-18.c scan-hidden private_extern[ \\t_]*_?foo
> FAIL: gcc.dg/visibility-19.c scan-hidden private_extern[ \\t_]*_?foo
>
>
> --
>           Summary: FAIL: gcc.dg/visibility-1[4-9].c
>           Product: gcc
>           Version: 4.4.0
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: testsuite
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: dominiq at lps dot ens dot fr
>  GCC build triplet: *-apple-darwin*
>  GCC host triplet: *-apple-darwin*
> GCC target triplet: *-apple-darwin*
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37202
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>



Comment 2 Dominique d'Humieres 2008-08-22 16:17:25 UTC
> This is a duplicate of 37170

I don't think so. Although I am bootstraping with the patch for 37170 and cannot conclude yet, my previous attempt fixed the weak tests, but not the visibility ones.

Comment 3 Eric Weddington 2008-08-25 05:22:48 UTC
These tests have also failed on AVR recently. Known fail on revision 139139.

And no, this is not a duplicate of 37170, as the patch for that bug fixes those test cases, but does not fix these. 
Comment 4 Andrew Pinski 2008-08-29 03:46:01 UTC
For darwin, the testcase should not be run as darwin does not require private_extern for hidden extern functions.


As for avr, the issue is most likely not using elfos.h or defining ASM_OUTPUT_EXTERNAL as default_elf_asm_output_external.
Comment 5 John David Anglin 2008-09-21 18:31:42 UTC
This is also failing on hppa-unknown-linux-gnu.  It uses the define in
elfos.h.  assemble_external is not called.  It looks like output_operand
is wrong:

output_operand (rtx x, int code ATTRIBUTE_UNUSED)
{
  if (x && GET_CODE (x) == SUBREG)
    x = alter_subreg (&x);

  /* X must not be a pseudo reg.  */
  gcc_assert (!x || !REG_P (x) || REGNO (x) < FIRST_PSEUDO_REGISTER);

  PRINT_OPERAND (asm_out_file, x, code);
  if (x && MEM_P (x) && GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
    {
      tree t;
      x = XEXP (x, 0);
      t = SYMBOL_REF_DECL (x);
      if (t)
        assemble_external (t);
    }
}

Breakpoint 4, output_operand (x=0x40146480, code=72)
    at ../../gcc/gcc/final.c:3365
3365	  if (x && GET_CODE (x) == SUBREG)
(gdb) p debug_rtx (x)
(symbol_ref:SI ("foo") [flags 0x42] <var_decl 0x400e70b0 foo>)
Comment 6 John David Anglin 2008-09-21 18:53:43 UTC
> This is also failing on hppa-unknown-linux-gnu.  It uses the define in
> elfos.h.  assemble_external is not called.  It looks like output_operand
> is wrong:

That rings a bell.  I believe H-P's proposed patch fixes this.  See
http://gcc.gnu.org/ml/gcc-patches/2008-09/msg00195.html
Comment 7 Dominique d'Humieres 2008-09-21 19:11:57 UTC
On Darwin the patch refered to in comment #6 fixes the weak issues but not the visibility failures.

Comment 8 pinskia@gmail.com 2008-09-21 19:15:43 UTC
Subject: Re:  FAIL: gcc.dg/visibility-1[4-9].c



Sent from my iPhone

On Sep 21, 2008, at 12:11 PM, "dominiq at lps dot ens dot fr" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

>
>
> ------- Comment #7 from dominiq at lps dot ens dot fr  2008-09-21  
> 19:11 -------
> On Darwin the patch refered to in comment #6 fixes the weak issues  
> but not the
> visibility failures.

As mentioned so many times. These testcases should be disabled for  
Darwin.

>
>
>
> -- 
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37202
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
Comment 9 Dominique d'Humieres 2008-09-21 19:37:39 UTC
> As mentioned so many times. These testcases should be disabled for  Darwin.

Then who is supposed to do it?

Comment 10 Jack Howarth 2008-09-21 21:45:47 UTC
Dominique,
       Just post a proposed patch to gcc-patches that disables these tests and cc the original author of the tests and one of the current Darwin maintainers such as Mike Stump.
Comment 11 Dominique d'Humieres 2008-11-05 13:29:57 UTC
Could somebody check if the following changes are OK?

diff -u ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-14.c gcc/testsuite/gcc.dg/visibility-14.c
--- ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-14.c  2008-08-19 18:11:26.000000000 +0200
+++ gcc/testsuite/gcc.dg/visibility-14.c        2008-11-05 14:17:04.000000000 +0100
@@ -1,7 +1,7 @@
 /* Test that called external functions are marked. */
 /* { dg-do compile } */
 /* { dg-require-visibility "" } */
-/* { dg-final { scan-hidden "foo" } } */
+/* { dg-final { scan-hidden "foo" { target !*-apple-darwin* } } } */
 
 extern void foo(void) __attribute__ ((visibility ("hidden")));
 int f () {
diff -u ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-15.c gcc/testsuite/gcc.dg/visibility-15.c
--- ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-15.c  2008-08-19 18:11:25.000000000 +0200
+++ gcc/testsuite/gcc.dg/visibility-15.c        2008-11-05 14:20:25.000000000 +0100
@@ -1,7 +1,7 @@
 /* Test that accessed external functions are marked. */
 /* { dg-do compile } */
 /* { dg-require-visibility "" } */
-/* { dg-final { scan-hidden "foo" } } */
+/* { dg-final { scan-hidden "foo" { target !*-apple-darwin* } } } */
 
 extern void foo(void) __attribute__ ((visibility ("hidden")));
 typedef void (*foo_t)(void);
diff -u ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-16.c gcc/testsuite/gcc.dg/visibility-16.c
--- ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-16.c  2008-08-19 18:11:26.000000000 +0200
+++ gcc/testsuite/gcc.dg/visibility-16.c        2008-11-05 14:20:42.000000000 +0100
@@ -1,7 +1,7 @@
 /* Test that accessed external variables are marked. */
 /* { dg-do compile } */
 /* { dg-require-visibility "" } */
-/* { dg-final { scan-hidden "foo" } } */
+/* { dg-final { scan-hidden "foo" { target !*-apple-darwin* } } } */
 
 extern int foo __attribute__ ((visibility ("hidden")));
 int f () {
diff -u ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-17.c gcc/testsuite/gcc.dg/visibility-17.c
--- ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-17.c  2008-08-19 18:11:25.000000000 +0200
+++ gcc/testsuite/gcc.dg/visibility-17.c        2008-11-05 14:20:59.000000000 +0100
@@ -1,7 +1,7 @@
 /* Test that external variable whose address is taken are marked. */
 /* { dg-do compile } */
 /* { dg-require-visibility "" } */
-/* { dg-final { scan-hidden "foo" } } */
+/* { dg-final { scan-hidden "foo" { target !*-apple-darwin* } } } */
 
 extern int foo __attribute__ ((visibility ("hidden")));
 int *f () {
diff -u ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-18.c gcc/testsuite/gcc.dg/visibility-18.c
--- ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-18.c  2008-08-19 18:11:27.000000000 +0200
+++ gcc/testsuite/gcc.dg/visibility-18.c        2008-11-05 14:21:11.000000000 +0100
@@ -1,7 +1,7 @@
 /* Test that external variable whose address is taken are marked. */
 /* { dg-do compile } */
 /* { dg-require-visibility "" } */
-/* { dg-final { scan-hidden "foo" } } */
+/* { dg-final { scan-hidden "foo" { target !*-apple-darwin* } } } */
 
 extern int foo __attribute__ ((visibility ("hidden")));
 int *test = &foo;
diff -u ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-19.c gcc/testsuite/gcc.dg/visibility-19.c
--- ../_gcc_clean/gcc/testsuite/gcc.dg/visibility-19.c  2008-08-19 18:11:25.000000000 +0200
+++ gcc/testsuite/gcc.dg/visibility-19.c        2008-11-05 14:21:27.000000000 +0100
@@ -1,7 +1,7 @@
 /* Test that accessed external functions are marked. */
 /* { dg-do compile } */
 /* { dg-require-visibility "" } */
-/* { dg-final { scan-hidden "foo" } } */
+/* { dg-final { scan-hidden "foo" { target !*-apple-darwin* } } } */
 
 extern void foo(void) __attribute__ ((visibility ("hidden")));
 typedef void (*foo_t)(void);

Comment 12 Jack Howarth 2008-11-11 15:33:06 UTC
Posted patch to gcc-patches mailing list...

http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00428.html
Comment 13 Mike Stump 2008-11-11 23:13:45 UTC
The darwin patch is fine.
Comment 14 Janis Johnson 2008-11-12 17:48:38 UTC
Subject: Bug 37202

Author: janis
Date: Wed Nov 12 17:47:13 2008
New Revision: 141794

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141794
Log:
2008-11-12  Jack Howarth  <howarth@bromo.med.uc.edu>

	PR testsuite/37202
	* gcc.dg/visibility-14.c:  Skip on *-*-darwin*.
	* gcc.dg/visibility-15.c:  Same.
	* gcc.dg/visibility-16.c:  Same.
	* gcc.dg/visibility-17.c:  Same.
	* gcc.dg/visibility-18.c:  Same.
	* gcc.dg/visibility-19.c:  Same.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/visibility-14.c
    trunk/gcc/testsuite/gcc.dg/visibility-15.c
    trunk/gcc/testsuite/gcc.dg/visibility-16.c
    trunk/gcc/testsuite/gcc.dg/visibility-17.c
    trunk/gcc/testsuite/gcc.dg/visibility-18.c
    trunk/gcc/testsuite/gcc.dg/visibility-19.c

Comment 15 Andrew Pinski 2008-12-27 05:46:52 UTC
Fixed.