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

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