mirrored from git://gcc.gnu.org/git/gcc.git
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backport: re PR tree-optimization/81503 (Wrong code at -O2)
[gcc] 2017-09-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com> Backport from mainline 2017-08-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com> Jakub Jelinek <jakub@redhat.com> Richard Biener <rguenther@suse.de> PR tree-optimization/81503 * gimple-ssa-strength-reduction.c (replace_mult_candidate): Ensure folded constant fits in the target type; reorder tests for clarity. [gcc/testsuite] 2017-09-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com> Backport from mainline 2017-08-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com> Jakub Jelinek <jakub@redhat.com> Richard Biener <rguenther@suse.de> PR tree-optimization/81503 * gcc.c-torture/execute/pr81503.c: New file. From-SVN: r251743
- Loading branch information
1 parent
db72abb
commit 540b5cb
Showing
4 changed files
with
119 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
unsigned short a = 41461; | ||
unsigned short b = 3419; | ||
int c = 0; | ||
|
||
void foo() { | ||
if (a + b * ~(0 != 5)) | ||
c = -~(b * ~(0 != 5)) + 2147483647; | ||
} | ||
|
||
int main() { | ||
foo(); | ||
if (c != 2147476810) | ||
return -1; | ||
return 0; | ||
} |