This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80825] New: Result of a right-shift of a signed negative number
- From: "henry0312 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 19 May 2017 08:14:27 +0000
- Subject: [Bug c++/80825] New: Result of a right-shift of a signed negative number
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80825
Bug ID: 80825
Summary: Result of a right-shift of a signed negative number
Product: gcc
Version: 7.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: henry0312 at gmail dot com
Target Milestone: ---
The result of a right-shift of a signed negative number has been changed
between 6.3.0 and 7.1.0.
I expect `a` to be positive, but `a` may be negative.
This issue will be happned with -O2 or -O3.
gcc 7.1.0
https://wandbox.org/permlink/hEn5goNhERtLNN5Q
gcc 6.3.0
https://wandbox.org/permlink/jVDXqdRjR6smHN0M
I guess that `& 0x7FFF` is ignogred in gcc 7.1.0.