public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/34916]  New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
@ 2008-01-22  0:16 pmarques at grupopie dot com
  2008-01-22  0:53 ` [Bug target/34916] " hutchinsonandy at aim dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: pmarques at grupopie dot com @ 2008-01-22  0:16 UTC (permalink / raw)
  To: gcc-bugs

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 <f+0x38>
   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


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-04-12 15:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-22  0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
2008-01-22  0:53 ` [Bug target/34916] " hutchinsonandy at aim dot com
2008-01-22  0:59 ` hutchinsonandy at aim dot com
2008-01-22  1:06 ` hutchinsonandy at aim dot com
2008-01-23  0:03 ` hutchinsonandy at aim dot com
2008-01-23  5:21 ` [Bug target/34916] [4.3 Regression] " pmarques at grupopie dot com
2008-01-23 19:31 ` manu at gcc dot gnu dot org
2008-01-23 21:25 ` jakub at gcc dot gnu dot org
2008-03-15  0:44 ` [Bug target/34916] [4.3/4.4 " jsm28 at gcc dot gnu dot org
2008-03-15 23:41 ` hutchinsonandy at aim dot com
2008-04-04 22:35 ` eric dot weddington at atmel dot com
2008-04-04 23:47 ` hutchinsonandy at gcc dot gnu dot org
2008-04-08 15:17 ` eric dot weddington at atmel dot com
2008-04-08 17:24 ` hutchinsonandy at aim dot com
2008-04-09 22:52 ` hutchinsonandy at gcc dot gnu dot org
2008-04-12 15:38 ` hutchinsonandy at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).