This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug testsuite/34889] New: gcc.c-torture/execute/builtins/pr23484-chk.c fails on 16 bit integer platforms
- From: "pmarques at grupopie dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jan 2008 19:38:42 -0000
- Subject: [Bug testsuite/34889] New: gcc.c-torture/execute/builtins/pr23484-chk.c fails on 16 bit integer platforms
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc.c-torture/execute/builtins/pr23484-chk.c has on line 44:
if (snprintf (buf, l1 ? sizeof (buf) : 4, "%d", l1 + 65536) != 5
|| memcmp (buf, "655\0LLLL", 8))
but on a 16 bit platform like the avr, the "l1 + 65536" overflows and gives the
wrong result. Changing that to:
if (snprintf (buf, l1 ? sizeof (buf) : 4, "%d", l1 + 32760) != 5
|| memcmp (buf, "327\0LLLL", 8))
fixes the problem.
--
Summary: gcc.c-torture/execute/builtins/pr23484-chk.c fails on 16
bit integer platforms
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: testsuite
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pmarques at grupopie dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34889