From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12043 invoked by alias); 2 May 2006 17:14:39 -0000 Received: (qmail 12010 invoked by uid 48); 2 May 2006 17:14:35 -0000 Date: Tue, 02 May 2006 17:14:00 -0000 Subject: [Bug tree-optimization/27394] New: double -> char conversion varies with optimization level X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "amylaar at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-05/txt/msg00194.txt.bz2 List-Id: This testcase: int f () { double d = 128.; return (signed char) d; } int main () { return f () != -128; } Succeeds at -O0 and fails at -O1. While the C standard says that the result of the conversion is unspecified, it is a quality of implementation issue to give, where reasonably possible, the same results when optimizing as when not optimizing. Doing otherwise makes debugging unnecessarily difficult. -- Summary: double -> char conversion varies with optimization level Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: amylaar at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27394