re PR c/42544 (Bad codegen with signed short cast to unsigned int, then promoted...
authorJakub Jelinek <jakub@redhat.com>
Mon, 21 Mar 2011 17:57:34 +0000 (18:57 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 21 Mar 2011 17:57:34 +0000 (18:57 +0100)
commit126e660935733b9141a2bc23dec3ed25fa339310
treea599d6407fcac6fa3c455a61f9abe5fc1d927338
parent9dfd55f55b725d4e20f18e2824b7193d7ffd8715
re PR c/42544 (Bad codegen with signed short cast to unsigned int, then promoted to unsigned long long)

PR c/42544
PR c/48197
* c-common.c (shorten_compare): If primopN is first sign-extended
to opN and then zero-extended to result type, set primopN to opN.

* gcc.c-torture/execute/pr42544.c: New test.
* gcc.c-torture/execute/pr48197.c: New test.

From-SVN: r171252
gcc/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr42544.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr48197.c [new file with mode: 0644]