public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/66650] New: libgfortran: warning: left shift of negative value [-Wshift-negative-value]
@ 2015-06-24 14:13 tschwinge at gcc dot gnu.org
  2015-07-29 11:49 ` [Bug libfortran/66650] " ubizjak at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2015-06-24 14:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66650
           Summary: libgfortran: warning: left shift of negative value
                    [-Wshift-negative-value]
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: mpolacek at gcc dot gnu.org
  Target Milestone: ---

As of the changes in context of PR65179,
<http://news.gmane.org/find-root.php?message_id=%3C20150422183633.GI28950%40redhat.com%3E>,
I'm seeing a bunch of -Wshift-negative-value warnings in the libgfortran build,
for example:

    In file included from [...]/libgfortran/intrinsics/cshift0.c:26:0:
    [...]/libgfortran/intrinsics/cshift0.c: In function 'cshift0':
    [...]/libgfortran/libgfortran.h:408:48: warning: left shift of negative
value [-Wshift-negative-value]
       ((~((index_type) 0) >> GFC_DTYPE_SIZE_SHIFT) << GFC_DTYPE_SIZE_SHIFT)
                                                    ^
    [...]/libgfortran/libgfortran.h:409:35: note: in expansion of macro
'GFC_DTYPE_SIZE_MASK'
     #define GFC_DTYPE_TYPE_SIZE_MASK (GFC_DTYPE_SIZE_MASK |
GFC_DTYPE_TYPE_MASK)
                                       ^
    [...]/libgfortran/libgfortran.h:411:52: note: in expansion of macro
'GFC_DTYPE_TYPE_SIZE_MASK'
     #define GFC_DTYPE_TYPE_SIZE(desc) ((desc)->dtype &
GFC_DTYPE_TYPE_SIZE_MASK)
                                                        ^
    [...]/libgfortran/intrinsics/cshift0.c:94:15: note: in expansion of macro
'GFC_DTYPE_TYPE_SIZE'
       type_size = GFC_DTYPE_TYPE_SIZE (array);
                   ^

Unless this will be resolved by demoting the warning (I have not reviewed the
recent discussion, such as PR66066,
<http://news.gmane.org/find-root.php?message_id=%3C20150511142112.GO3384%40redhat.com%3E>),
I supposed this should be fixed in libgfortran/libgfortran.h, perhaps by making
index_type an unsiged type if that's possible?


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

* [Bug libfortran/66650] libgfortran: warning: left shift of negative value [-Wshift-negative-value]
  2015-06-24 14:13 [Bug libfortran/66650] New: libgfortran: warning: left shift of negative value [-Wshift-negative-value] tschwinge at gcc dot gnu.org
@ 2015-07-29 11:49 ` ubizjak at gmail dot com
  2015-07-29 15:42 ` uros at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2015-07-29 11:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
Patch that rewrites GFC_DTYPE_SIZE_MASK definition to avoid "left shift of
negative value" warning:

--cut here--
Index: libgfortran.h
===================================================================
--- libgfortran.h       (revision 226339)
+++ libgfortran.h       (working copy)
@@ -404,8 +404,7 @@

 /* Macros to get both the size and the type with a single masking operation 
*/

-#define GFC_DTYPE_SIZE_MASK \
-  ((~((index_type) 0) >> GFC_DTYPE_SIZE_SHIFT) << GFC_DTYPE_SIZE_SHIFT)
+#define GFC_DTYPE_SIZE_MASK (-((index_type) 1 << GFC_DTYPE_SIZE_SHIFT))
 #define GFC_DTYPE_TYPE_SIZE_MASK (GFC_DTYPE_SIZE_MASK | GFC_DTYPE_TYPE_MASK)

 #define GFC_DTYPE_TYPE_SIZE(desc) ((desc)->dtype & GFC_DTYPE_TYPE_SIZE_MASK)
--cut here--
>From gcc-bugs-return-493652-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 29 12:14:54 2015
Return-Path: <gcc-bugs-return-493652-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 110249 invoked by alias); 29 Jul 2015 12:14:53 -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 110213 invoked by uid 48); 29 Jul 2015 12:14:50 -0000
From: "balder@yahoo-inc.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67055] Segmentation fault in fold_builtin_alloca_with_align in tree-ssa-ccp.c
Date: Wed, 29 Jul 2015 12:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.2.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: major
X-Bugzilla-Who: balder@yahoo-inc.com
X-Bugzilla-Status: WAITING
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:
Message-ID: <bug-67055-4-Nlu4n7qwll@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67055-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67055-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/msg02542.txt.bz2
Content-length: 229

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

--- Comment #5 from Henning Baldersheim <balder@yahoo-inc.com> ---
Actually -fno-inline-functions was enough as a workaround. Then I can still use
the same general -O3 option.


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

* [Bug libfortran/66650] libgfortran: warning: left shift of negative value [-Wshift-negative-value]
  2015-06-24 14:13 [Bug libfortran/66650] New: libgfortran: warning: left shift of negative value [-Wshift-negative-value] tschwinge at gcc dot gnu.org
  2015-07-29 11:49 ` [Bug libfortran/66650] " ubizjak at gmail dot com
@ 2015-07-29 15:42 ` uros at gcc dot gnu.org
  2015-07-29 17:13 ` uros at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: uros at gcc dot gnu.org @ 2015-07-29 15:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from uros at gcc dot gnu.org ---
Author: uros
Date: Wed Jul 29 15:42:03 2015
New Revision: 226355

URL: https://gcc.gnu.org/viewcvs?rev=226355&root=gcc&view=rev
Log:
        PR libgfortran/66650
        * libgfortran.h (GFC_DTYPE_SIZE_MASK): Rewrite to avoid
        "left shift of negative value" warning.


Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/libgfortran.h


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

* [Bug libfortran/66650] libgfortran: warning: left shift of negative value [-Wshift-negative-value]
  2015-06-24 14:13 [Bug libfortran/66650] New: libgfortran: warning: left shift of negative value [-Wshift-negative-value] tschwinge at gcc dot gnu.org
  2015-07-29 11:49 ` [Bug libfortran/66650] " ubizjak at gmail dot com
  2015-07-29 15:42 ` uros at gcc dot gnu.org
@ 2015-07-29 17:13 ` uros at gcc dot gnu.org
  2015-07-29 17:45 ` uros at gcc dot gnu.org
  2015-07-29 17:46 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: uros at gcc dot gnu.org @ 2015-07-29 17:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from uros at gcc dot gnu.org ---
Author: uros
Date: Wed Jul 29 17:12:28 2015
New Revision: 226357

URL: https://gcc.gnu.org/viewcvs?rev=226357&root=gcc&view=rev
Log:
        PR libgfortran/66650
        * libgfortran.h (GFC_DTYPE_SIZE_MASK): Rewrite to avoid
        "left shift of negative value" warning.


Modified:
    branches/gcc-5-branch/libgfortran/ChangeLog
    branches/gcc-5-branch/libgfortran/libgfortran.h


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

* [Bug libfortran/66650] libgfortran: warning: left shift of negative value [-Wshift-negative-value]
  2015-06-24 14:13 [Bug libfortran/66650] New: libgfortran: warning: left shift of negative value [-Wshift-negative-value] tschwinge at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-07-29 17:13 ` uros at gcc dot gnu.org
@ 2015-07-29 17:45 ` uros at gcc dot gnu.org
  2015-07-29 17:46 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: uros at gcc dot gnu.org @ 2015-07-29 17:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from uros at gcc dot gnu.org ---
Author: uros
Date: Wed Jul 29 17:45:07 2015
New Revision: 226360

URL: https://gcc.gnu.org/viewcvs?rev=226360&root=gcc&view=rev
Log:
        PR libgfortran/66650
        * libgfortran.h (GFC_DTYPE_SIZE_MASK): Rewrite to avoid
        "left shift of negative value" warning.


Modified:
    branches/gcc-4_9-branch/libgfortran/ChangeLog
    branches/gcc-4_9-branch/libgfortran/libgfortran.h


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

* [Bug libfortran/66650] libgfortran: warning: left shift of negative value [-Wshift-negative-value]
  2015-06-24 14:13 [Bug libfortran/66650] New: libgfortran: warning: left shift of negative value [-Wshift-negative-value] tschwinge at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-07-29 17:45 ` uros at gcc dot gnu.org
@ 2015-07-29 17:46 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2015-07-29 17:46 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |ubizjak at gmail dot com
   Target Milestone|---                         |4.9.4

--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed everywhere.
>From gcc-bugs-return-493688-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 29 17:46:12 2015
Return-Path: <gcc-bugs-return-493688-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4705 invoked by alias); 29 Jul 2015 17:46:12 -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 4595 invoked by uid 48); 29 Jul 2015 17:46:03 -0000
From: "mars.lenjoy at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67058] Segmentation fault: 11 with >= in lambda in c++11
Date: Wed, 29 Jul 2015 17:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
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: mars.lenjoy at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: INVALID
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-67058-4-eaYrVkyXZt@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67058-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67058-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/msg02578.txt.bz2
Content-length: 245

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

--- Comment #2 from Lenjoy <mars.lenjoy at gmail dot com> ---
(In reply to Markus Trippelsdorf from comment #1)
> This is an LLVM bug.

okay, filed https://llvm.org/bugs/show_bug.cgi?id$304


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-24 14:13 [Bug libfortran/66650] New: libgfortran: warning: left shift of negative value [-Wshift-negative-value] tschwinge at gcc dot gnu.org
2015-07-29 11:49 ` [Bug libfortran/66650] " ubizjak at gmail dot com
2015-07-29 15:42 ` uros at gcc dot gnu.org
2015-07-29 17:13 ` uros at gcc dot gnu.org
2015-07-29 17:45 ` uros at gcc dot gnu.org
2015-07-29 17:46 ` ubizjak at gmail 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).