fold-const.c (fold): Convert (T)(x&c) into ((T)x&(T)c) for integer constant c (if...
authorRoger Sayle <roger@eyesopen.com>
Thu, 18 Apr 2002 10:39:41 +0000 (10:39 +0000)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 18 Apr 2002 10:39:41 +0000 (12:39 +0200)
commit58c2956cc78b5eac943d4c800f28faa9e7529b4e
tree0bdc385dfefe6169060b519e747fd90bf8ebb371
parent692efa8ed557524d30dc66687c3f5c58de1be9e3
fold-const.c (fold): Convert (T)(x&c) into ((T)x&(T)c) for integer constant c (if...

* fold-const.c (fold) [NOP_EXPR]: Convert (T)(x&c) into ((T)x&(T)c)
for integer constant c (if x has unsigned type or sign bit is not
set in c).  This folds the zero/sign extension into the bit-wise and
operation.

* gcc.c-torture/compile/20020415-1.c: New.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r52465
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20020415-1.c [new file with mode: 0644]