public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
@ 2015-03-20 21:54 danglin at gcc dot gnu.org
  2015-03-21  9:52 ` [Bug libstdc++/65500] " dave.anglin at bell dot net
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: danglin at gcc dot gnu.org @ 2015-03-20 21:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65500

            Bug ID: 65500
           Summary: [5 Regression] FAIL:
                    17_intro/headers/c++2014/all_attributes.cc (test for
                    excess errors)
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danglin at gcc dot gnu.org
              Host: hppa2.0w-hp-hpux11.11
            Target: hppa2.0w-hp-hpux11.11
             Build: hppa2.0w-hp-hpux11.11

spawn /test/gnu/gcc/objdir/./gcc/xg++ -shared-libgcc
-B/test/gnu/gcc/objdir/./gc
c -nostdinc++ -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src
-L/t
est/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src/.libs
-L/test/gnu/gcc/
objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/libsupc++/.libs
-B/opt/gnu/gcc/gcc-5.0
/hppa2.0w-hp-hpux11.11/bin/ -B/opt/gnu/gcc/gcc-5.0/hppa2.0w-hp-hpux11.11/lib/
-i
system /opt/gnu/gcc/gcc-5.0/hppa2.0w-hp-hpux11.11/include -isystem
/opt/gnu/gcc/
gcc-5.0/hppa2.0w-hp-hpux11.11/sys-include
-B/test/gnu/gcc/objdir/hppa2.0w-hp-hpu
x11.11/./libstdc++-v3/src/.libs -D_GLIBCXX_ASSERT -fmessage-length=0 -g -O2
-DLO
CALEDIR="." -nostdinc++
-I/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v
3/include/hppa2.0w-hp-hpux11.11
-I/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/lib
stdc++-v3/include -I/test/gnu/gcc/gcc/libstdc++-v3/libsupc++
-I/test/gnu/gcc/gcc
/libstdc++-v3/include/backward -I/test/gnu/gcc/gcc/libstdc++-v3/testsuite/util
/
test/gnu/gcc/gcc/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.
cc -std=gnu++14 -S -o all_attributes.s
In file included from /usr/include/pthread.h:7:0,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/in
clude/hppa2.0w-hp-hpux11.11/bits/gthr-default.h:35,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/in
clude/hppa2.0w-hp-hpux11.11/bits/gthr.h:148,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/atomicity.h:35,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/bits/ios_base.h:39,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ios:42,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/istream:38,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/sstream:38,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/complex:45,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ccomplex:38,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/hppa2.0w-hp-hpux11.11/bits/stdc++.h:52,
                 from
/test/gnu/gcc/gcc/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc:34:
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/shared_mutex:64:34:
error: narrowing conversion of '35985' from 'int' to 'short int' inside { }
     pthread_rwlock_t _M_rwlock = PTHREAD_RWLOCK_INITIALIZER;
                                  ^
compiler exited with status 1
output is:
In file included from /usr/include/pthread.h:7:0,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/hppa2.0w-hp-hpux11.11/bits/gthr-default.h:35,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/hppa2.0w-hp-hpux11.11/bits/gthr.h:148,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/atomicity.h:35,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/bits/ios_base.h:39,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ios:42,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/istream:38,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/sstream:38,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/complex:45,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ccomplex:38,
                 from
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/hppa2.0w-hp-hpux11.11/bits/stdc++.h:52,
                 from
/test/gnu/gcc/gcc/libstdc++-v3/testsuite/17_intro/headers/
c++2014/all_attributes.cc:34:
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/shared_mutex:64:34:
error: narrowing conversion of '35985' from 'int' to 'short int' inside { }
     pthread_rwlock_t _M_rwlock = PTHREAD_RWLOCK_INITIALIZER;
                                  ^

FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
Excess errors:
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/shared_mutex:64:34:
error: narrowing conversion of '35985' from 'int' to 'short int' inside { }

The define in sys/pthread.h is:
#define __LWP_RWLOCK_VALID              0x8c91

Similar fails:
FAIL: 30_threads/shared_lock/requirements/explicit_instantiation.cc (test for
excess errors)
FAIL: 30_threads/shared_lock/requirements/typedefs.cc (test for excess errors)
FAIL: 30_threads/shared_timed_mutex/requirements/standard_layout.cc (test for
excess errors)
FAIL: experimental/feat-cxx14.cc (test for excess errors)

r221202 was okay on hppa2.0w-hp-hpux11.11.
r221473 was okay on hppa64-hp-hpux11.11.


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

* [Bug libstdc++/65500] [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
  2015-03-20 21:54 [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) danglin at gcc dot gnu.org
@ 2015-03-21  9:52 ` dave.anglin at bell dot net
  2015-03-22 15:07 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dave.anglin at bell dot net @ 2015-03-21  9:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65500

--- Comment #1 from dave.anglin at bell dot net ---
On 2015-03-20, at 5:00 PM, danglin at gcc dot gnu.org wrote:

> FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
> Excess errors:
> /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/shared_mutex:64:34:
> error: narrowing conversion of '35985' from 'int' to 'short int' inside { }
> 
> The define in sys/pthread.h is:
> #define __LWP_RWLOCK_VALID              0x8c91

It looks like this bug was triggered by this change:

2015-03-18  Jonathan Wakely  <jwakely@redhat.com>
            Torvald Riegel  <triegel@redhat.com>

        * acinclude.m4 (GLIBCXX_CHECK_GTHREADS): Check for pthread_rwlock_t.
        * config.h.in: Regenerate.
        * configure: Regenerate.
        * include/std/shared_mutex: Check _GLIBCXX_USE_PTHREAD_RWLOCK_T.
        (shared_timed_mutex::_M_rwlock): Use PTHREAD_RWLOCK_INITIALIZER.
        (shared_timed_mutex::lock_shared()): Retry on EAGAIN.
        (shared_timed_mutex::try_lock_shared_until()): Retry on EAGAIN and
        EDEADLK.

At one time, GCC was permissive about system header issues, particularly when
they aren't
really a problem.  Is this still the case?

It looks like an include hack would fix but there's probably more issues like
this.

Dave
--
John David Anglin    dave.anglin@bell.net


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

* [Bug libstdc++/65500] [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
  2015-03-20 21:54 [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) danglin at gcc dot gnu.org
  2015-03-21  9:52 ` [Bug libstdc++/65500] " dave.anglin at bell dot net
@ 2015-03-22 15:07 ` redi at gcc dot gnu.org
  2015-03-23 14:21 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-22 15:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65500

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-03-22
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1


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

* [Bug libstdc++/65500] [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
  2015-03-20 21:54 [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) danglin at gcc dot gnu.org
  2015-03-21  9:52 ` [Bug libstdc++/65500] " dave.anglin at bell dot net
  2015-03-22 15:07 ` redi at gcc dot gnu.org
@ 2015-03-23 14:21 ` redi at gcc dot gnu.org
  2015-03-23 15:30 ` dave.anglin at bell dot net
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-23 14:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65500

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to dave.anglin from comment #1)
> At one time, GCC was permissive about system header issues, particularly
> when they aren't
> really a problem.  Is this still the case?

It is, yes, but this specific diagnostic is an error not just a warning and it
doesn't get disabled in system headers.

> It looks like an include hack would fix but there's probably more issues
> like this.

I think this isn't a widespread problem. We only use these
PTHREAD_XXX_INITIALIZER macros in a handful of places, and the other ones have
been there for some time without problems.

The choices seem to be:

1) Add an autoconf check to see if we can use the PTHREAD_RWLOCK_INITIALIZER
macro in this way, so that it falls back to the constructor+destructor if the
INITIALIZER macro can't be used.

2) Change the front-end to suppress narrowing errors in system headers.

3) Use fixincludes to change either the definition of __LWP_RWLOCK_VALID to
(short)0x8c91 or change the definition of PTHREAD_RWLOCK_INITIALIZER to use
(short)__LWP_RWLOCK_VALID


I don't like (1) because it would be a bit fragile and could introduce silent
ABI issues. If a later release of HPUX changes the INITIALIZER macro to avoid
the narrowing conversion, or if a later release of G++ does (2), then the
result of the autoconf check would change and would silently change whether a
std::shared_timed_mutex uses a constructor/destructor or not. Different
translation units built by different versions of GCC would disagree on how to
construct the objects.

Neither (1) nor (2) helps user code that wants to do:

  pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER;

which presumably fails with the same error when using g++ -std=c++11.

So I think a fixincludes to cast the constant to (short) is the best option. If
__LWP_RWLOCK_T is only used in the definition of PTHREAD_RWLOCK_INITIALIZER
then changing its definition is probably the simplest:

#define __LWP_RWLOCK_VALID              (short)0x8c91


I don't have any HPUX machines to try that with, would you be able to?


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

* [Bug libstdc++/65500] [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
  2015-03-20 21:54 [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) danglin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-23 14:21 ` redi at gcc dot gnu.org
@ 2015-03-23 15:30 ` dave.anglin at bell dot net
  2015-03-26 20:26 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dave.anglin at bell dot net @ 2015-03-23 15:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65500

--- Comment #3 from dave.anglin at bell dot net ---
On 2015-03-23 10:02 AM, redi at gcc dot gnu.org wrote:
> 3) Use fixincludes to change either the definition of __LWP_RWLOCK_VALID to
> (short)0x8c91 or change the definition of PTHREAD_RWLOCK_INITIALIZER to use
> (short)__LWP_RWLOCK_VALID
Instead of (short)0x8c91, I am testing patch with value changed to 
-29551.  The libstdc++
testsuite was clean with hppa64.  However, I hit a new issue in 32-bit 
build this morning.

Dave


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

* [Bug libstdc++/65500] [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
  2015-03-20 21:54 [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) danglin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-03-23 15:30 ` dave.anglin at bell dot net
@ 2015-03-26 20:26 ` redi at gcc dot gnu.org
  2015-03-28 19:25 ` danglin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-26 20:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65500

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW


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

* [Bug libstdc++/65500] [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
  2015-03-20 21:54 [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) danglin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-03-26 20:26 ` redi at gcc dot gnu.org
@ 2015-03-28 19:25 ` danglin at gcc dot gnu.org
  2015-03-30  0:50 ` danglin at gcc dot gnu.org
  2015-04-04  9:20 ` redi at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: danglin at gcc dot gnu.org @ 2015-03-28 19:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65500

--- Comment #4 from John David Anglin <danglin at gcc dot gnu.org> ---
Author: danglin
Date: Sat Mar 28 17:27:22 2015
New Revision: 221757

URL: https://gcc.gnu.org/viewcvs?rev=221757&root=gcc&view=rev
Log:
    PR libstdc++/65500
    * inclhack.def (hpux11_lwp_rwlock_valid): New fix.
    * fixincl.x: Regenerate.
    * tests/base/sys/pthread.h [HPUX11_LWP_RWLOCK_VALID_CHECK]: New test.


Modified:
    trunk/fixincludes/ChangeLog
    trunk/fixincludes/fixincl.x
    trunk/fixincludes/inclhack.def
    trunk/fixincludes/tests/base/sys/pthread.h


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

* [Bug libstdc++/65500] [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
  2015-03-20 21:54 [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) danglin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2015-03-28 19:25 ` danglin at gcc dot gnu.org
@ 2015-03-30  0:50 ` danglin at gcc dot gnu.org
  2015-04-04  9:20 ` redi at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: danglin at gcc dot gnu.org @ 2015-03-30  0:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65500

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from John David Anglin <danglin at gcc dot gnu.org> ---
Testsuite failures are fixed.


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

* [Bug libstdc++/65500] [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors)
  2015-03-20 21:54 [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) danglin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2015-03-30  0:50 ` danglin at gcc dot gnu.org
@ 2015-04-04  9:20 ` redi at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-04  9:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65500

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
After some discussion with Torvald I'm wondering whether it would be better to
never use the PTHREAD_RWLOCK_INITIALIZER macro anyway, so we can initialize the
rwlock with (non-standard) attributes such as
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP


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

end of thread, other threads:[~2015-04-04  9:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20 21:54 [Bug libstdc++/65500] New: [5 Regression] FAIL: 17_intro/headers/c++2014/all_attributes.cc (test for excess errors) danglin at gcc dot gnu.org
2015-03-21  9:52 ` [Bug libstdc++/65500] " dave.anglin at bell dot net
2015-03-22 15:07 ` redi at gcc dot gnu.org
2015-03-23 14:21 ` redi at gcc dot gnu.org
2015-03-23 15:30 ` dave.anglin at bell dot net
2015-03-26 20:26 ` redi at gcc dot gnu.org
2015-03-28 19:25 ` danglin at gcc dot gnu.org
2015-03-30  0:50 ` danglin at gcc dot gnu.org
2015-04-04  9:20 ` redi 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).