This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42544] Bad codegen with signed short cast to unsigned int, then promoted to unsigned long long
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 21 Mar 2011 17:58:21 +0000
- Subject: [Bug c/42544] Bad codegen with signed short cast to unsigned int, then promoted to unsigned long long
- Auto-submitted: auto-generated
- References: <bug-42544-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42544
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-21 17:57:40 UTC ---
Author: jakub
Date: Mon Mar 21 17:57:34 2011
New Revision: 171252
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171252
Log:
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.
Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr42544.c
trunk/gcc/testsuite/gcc.c-torture/execute/pr48197.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/testsuite/ChangeLog