From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69967 invoked by alias); 24 Jun 2015 14:13:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 69532 invoked by uid 48); 24 Jun 2015 14:13:50 -0000 From: "tschwinge at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/66650] New: libgfortran: warning: left shift of negative value [-Wshift-negative-value] Date: Wed, 24 Jun 2015 14:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tschwinge at gcc dot gnu.org 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 cc target_milestone Message-ID: 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-06/txt/msg02403.txt.bz2 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, , 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, ), I supposed this should be fixed in libgfortran/libgfortran.h, perhaps by making index_type an unsiged type if that's possible?