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.
Created attachment 14979 [details] the attached patch implements the proposed change
Paulo, please send the proposed patch to gcc-patches@gcc.gnu.org with an appropriate ChangeLog entry.
Subject: Bug 34889 Author: hutchinsonandy Date: Tue May 20 23:56:28 2008 New Revision: 135694 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135694 Log: PR testsuite/34889 * gcc.c-torture/execute/builtins/pr23484-chk.c : Correct test for 16bit int target. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk.c
Fixed 4.4. Needs backport to 4.3 sometime.