public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/67009] New: libsanitizer:  shift overflow warnings when boot strapping 32 bit library
@ 2015-07-25 17:47 gary at intrepid dot com
  2015-07-25 20:02 ` [Bug sanitizer/67009] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gary at intrepid dot com @ 2015-07-25 17:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67009
           Summary: libsanitizer:  shift overflow warnings when boot
                    strapping 32 bit library
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gary at intrepid dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

After a recent update, I noticed the following warnings in the 32-bit build of
libsanitizer.


/eng/upc/dev/gary/gupc-merge/src/gupc/libsanitizer/tsan/tsan_sync.h:86:35:
warning: result of ‘(3 << 30)’ requires 33 bits to represent, but ‘int’ only
has 32 bits [-Wshift-overflow=]
/eng/upc/dev/gary/gupc-merge/src/gupc/libsanitizer/tsan/tsan_sync.h:88:35:
warning: result of ‘(2 << 30)’ requires 33 bits to represent, but ‘int’ only
has 32 bits [-Wshift-overflow=]
/eng/upc/dev/gary/gupc-merge/src/gupc/libsanitizer/tsan/tsan_sync.h:86:35:
warning: result of ‘(3 << 30)’ requires 33 bits to represent, but ‘int’ only
has 32
>From gcc-bugs-return-493329-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jul 25 17:47:43 2015
Return-Path: <gcc-bugs-return-493329-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13242 invoked by alias); 25 Jul 2015 17:47:42 -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 13080 invoked by uid 48); 25 Jul 2015 17:47:38 -0000
From: "anders.granlund.0 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67010] New: Name hiding in the same declarative region fails when done via using-directive
Date: Sat, 25 Jul 2015 17:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: anders.granlund.0 at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-67010-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: 2015-07/txt/msg02219.txt.bz2
Content-length: 1242

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg010

            Bug ID: 67010
           Summary: Name hiding in the same declarative region fails when
                    done via using-directive
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anders.granlund.0 at gmail dot com
  Target Milestone: ---

Consider the following well-formed program:

  namespace N { struct x {}; }
  using namespace N;
  int x;
  int main() { sizeof (x); }

Compile it with the following command line:

  g++ prog.cc -std=c++14 -pedantic-errors

Observe that error messages about name lookup ambiguity are given. I expect to
get no errors when compiling since the program is well-formed.

That the program is well-formed can be seen by applying both [namespace.udir]/2
and [basic.scope.hiding]/2:

  http://eel.is/c++draft/dcl.dcl#namespace.udir-2
  http://eel.is/c++draft/basic.scope.hiding#2

This seems reasonable also, so I don't think this is a defect of the c++
standard.

I tried it with gcc HEAD 6.0.0 201507 here:

  http://melpon.org/wandbox/permlink/GmJgvsbjt5CPdWrA


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

* [Bug sanitizer/67009] libsanitizer:  shift overflow warnings when boot strapping 32 bit library
  2015-07-25 17:47 [Bug sanitizer/67009] New: libsanitizer: shift overflow warnings when boot strapping 32 bit library gary at intrepid dot com
@ 2015-07-25 20:02 ` pinskia at gcc dot gnu.org
  2015-07-26  7:48 ` dvyukov at google dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-07-25 20:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
tsan should not be building for 32bits.


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

* [Bug sanitizer/67009] libsanitizer:  shift overflow warnings when boot strapping 32 bit library
  2015-07-25 17:47 [Bug sanitizer/67009] New: libsanitizer: shift overflow warnings when boot strapping 32 bit library gary at intrepid dot com
  2015-07-25 20:02 ` [Bug sanitizer/67009] " pinskia at gcc dot gnu.org
@ 2015-07-26  7:48 ` dvyukov at google dot com
  2015-07-26 16:43 ` miyuki at gcc dot gnu.org
  2015-07-26 17:33 ` gary at intrepid dot com
  3 siblings, 0 replies; 5+ messages in thread
From: dvyukov at google dot com @ 2015-07-26  7:48 UTC (permalink / raw)
  To: gcc-bugs

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

Dmitry Vyukov <dvyukov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dvyukov at google dot com

--- Comment #2 from Dmitry Vyukov <dvyukov at google dot com> ---
Thanks, Gary.
I fixed this upstream in revision 243241:
http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_sync.h?r1=243241&r2=243240&pathrev=243241
Now we need to wait for the next integrate.


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

* [Bug sanitizer/67009] libsanitizer:  shift overflow warnings when boot strapping 32 bit library
  2015-07-25 17:47 [Bug sanitizer/67009] New: libsanitizer: shift overflow warnings when boot strapping 32 bit library gary at intrepid dot com
  2015-07-25 20:02 ` [Bug sanitizer/67009] " pinskia at gcc dot gnu.org
  2015-07-26  7:48 ` dvyukov at google dot com
@ 2015-07-26 16:43 ` miyuki at gcc dot gnu.org
  2015-07-26 17:33 ` gary at intrepid dot com
  3 siblings, 0 replies; 5+ messages in thread
From: miyuki at gcc dot gnu.org @ 2015-07-26 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

Mikhail Maltsev <miyuki at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-07-26
                 CC|                            |miyuki at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Mikhail Maltsev <miyuki at gcc dot gnu.org> ---
Confirmed, I also see it in my builds since 20.07 (several cases of
-Wshift-overflow were implemented in r225998).

(In reply to Andrew Pinski from comment #1)
> tsan should not be building for 32bits.

The warning appears in 64-bit build either.


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

* [Bug sanitizer/67009] libsanitizer:  shift overflow warnings when boot strapping 32 bit library
  2015-07-25 17:47 [Bug sanitizer/67009] New: libsanitizer: shift overflow warnings when boot strapping 32 bit library gary at intrepid dot com
                   ` (2 preceding siblings ...)
  2015-07-26 16:43 ` miyuki at gcc dot gnu.org
@ 2015-07-26 17:33 ` gary at intrepid dot com
  3 siblings, 0 replies; 5+ messages in thread
From: gary at intrepid dot com @ 2015-07-26 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Gary Funck <gary at intrepid dot com> ---
(In reply to Mikhail Maltsev from comment #3)
> Confirmed, I also see it in my builds since 20.07 (several cases of
> -Wshift-overflow were implemented in r225998).
> 
> (In reply to Andrew Pinski from comment #1)
> > tsan should not be building for 32bits.
> 
> The warning appears in 64-bit build either.

Perhaps the 32-bit configure/build issue should be broken out as a separate PR
and the subject line for this issue changed to reflect that the overflow
warnings aren't 32-bit specific.


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

end of thread, other threads:[~2015-07-26 17:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-25 17:47 [Bug sanitizer/67009] New: libsanitizer: shift overflow warnings when boot strapping 32 bit library gary at intrepid dot com
2015-07-25 20:02 ` [Bug sanitizer/67009] " pinskia at gcc dot gnu.org
2015-07-26  7:48 ` dvyukov at google dot com
2015-07-26 16:43 ` miyuki at gcc dot gnu.org
2015-07-26 17:33 ` gary at intrepid dot com

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).