forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PR middle-end/71654 (missed shortening of a compare)
gcc/ChangeLog: PR middle-end/71654 * match.pd ((T)A CMP (T)B -> A CMP B): Allow (T)A to be a sign-changing cast from a shorter unsigned type to a wider signed type. gcc/testsuite/ChangeLog: PR middle-end/71654 * gcc.dg/c-c++-common/pr71654.c: New test. * gcc.dg/tree-ssa/vrp23: Add -fno-tree-forwprop to dg-options. * gcc.dg/tree-ssa/vrp24: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239421 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
ppalka
committed
Aug 12, 2016
1 parent
7175bb2
commit 7079d57
Showing
6 changed files
with
48 additions
and
3 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,28 @@ | ||
/* PR middle-end/71654 */ | ||
/* { dg-do link } */ | ||
/* { dg-options "-O2" } */ | ||
|
||
unsigned char i0, i1; | ||
|
||
void foo (void); | ||
|
||
int | ||
main (void) | ||
{ | ||
int j = i0; | ||
if (j < 4) | ||
{ | ||
if (i0 & 4) | ||
foo (); | ||
} | ||
|
||
unsigned int k = i1; | ||
if (k < 8) | ||
{ | ||
if (i1 & 8) | ||
foo (); | ||
} | ||
|
||
return 0; | ||
} | ||
|
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