User account creation filtered due to spam.

Bug 34889

Summary: gcc.c-torture/execute/builtins/pr23484-chk.c fails on 16 bit integer platforms
Product: gcc Reporter: Paulo Marques <pmarques>
Component: testsuiteAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: eric.weddington, gcc-bugs
Priority: P3    
Version: 4.3.0   
Target Milestone: 4.3.2   
Host: i686-pc-linux-gnu Target: avr-*-*
Build: i686-pc-linux-gnu Known to work:
Known to fail: Last reconfirmed:
Attachments: the attached patch implements the proposed change

Description Paulo Marques 2008-01-20 19:38:42 UTC
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.
Comment 1 Paulo Marques 2008-01-20 19:39:30 UTC
Created attachment 14979 [details]
the attached patch implements the proposed change
Comment 2 Janis Johnson 2008-05-15 21:09:07 UTC
Paulo, please send the proposed patch to gcc-patches@gcc.gnu.org with an appropriate ChangeLog entry.
Comment 3 Andy Hutchinson 2008-05-20 23:57:11 UTC
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

Comment 4 Andy Hutchinson 2008-06-04 01:57:02 UTC
Fixed 4.4.
Needs backport to 4.3 sometime.