From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13910 invoked by alias); 16 Mar 2002 23:01:57 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 13846 invoked by uid 61); 16 Mar 2002 23:01:56 -0000 Date: Sat, 16 Mar 2002 15:01:00 -0000 Message-ID: <20020316230156.13845.qmail@sources.redhat.com> To: dash@xdr.com, dberlin@sources.redhat.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: dberlin@sources.redhat.com Reply-To: dberlin@sources.redhat.com, dash@xdr.com, dberlin@sources.redhat.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org X-Mailer: gnatsweb 2.9.3 Subject: Re: optimization/5969: When function is declared func(unsigned char v), v isn't truncated X-SW-Source: 2002-03/txt/msg00587.txt.bz2 List-Id: Synopsis: When function is declared func(unsigned char v), v isn't truncated Responsible-Changed-From-To: unassigned->dberlin Responsible-Changed-By: dberlin Responsible-Changed-When: Sat Mar 16 15:01:56 2002 Responsible-Changed-Why: Me State-Changed-From-To: open->feedback State-Changed-By: dberlin State-Changed-When: Sat Mar 16 15:01:56 2002 State-Changed-Why: You have implicitly declared tst to take an int by using it before it's defined. Because it is inlined into main at -O2, and at that point it thinks it takes an int, it never performs the truncation. Any code after the tst function is defined to take an unsigned char will do the truncation. The problem is the code, not the compiler, AFAIK. The title of the bug report is misleading, you haven't declared func(unsigned char v), if you did, the problem would go away. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5969