From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27042 invoked by alias); 21 Jan 2008 23:56:41 -0000 Received: (qmail 26445 invoked by uid 48); 21 Jan 2008 23:55:55 -0000 Date: Tue, 22 Jan 2008 00:16:00 -0000 Subject: [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pmarques at grupopie dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg02465.txt.bz2 This test case fails with latest gcc 4.3.0. The test assumes 32 bit integers, but even after changing the constants to long, it produces incorrect results. With -O2 we get this: int f(unsigned number_of_digits_to_use) { if (number_of_digits_to_use > 1294) 206: 65 e0 ldi r22, 0x05 ; 5 208: 8f 30 cpi r24, 0x0F ; 15 20a: 96 07 cpc r25, r22 20c: c0 f4 brcc .+48 ; 0x23e return 0; return ((number_of_digits_to_use * 3321928L) / 1000000L + 1) /16; 20e: bc 01 movw r22, r24 210: 80 e0 ldi r24, 0x00 ; 0 212: 90 e0 ldi r25, 0x00 ; 0 214: 0e 94 6c 06 call 0xcd8 ; 0xcd8 <__mulsi3> [...] It "forgets" to load r18:r19:r20:r21 with 3321928 before calling __mulsi3. -- Summary: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target 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=34916