public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38469]  New: Wrong code for a function with long long argument returning int.
@ 2008-12-10 10:27 niva at niisi dot msk dot ru
  2008-12-15 21:43 ` [Bug c/38469] " rsandifo at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: niva at niisi dot msk dot ru @ 2008-12-10 10:27 UTC (permalink / raw)
  To: gcc-bugs

We used the snapshot gcc-4.1-20080630.

The command line is:
mips64-none-elf-gcc-4.1.3 -O1 -mabi=o64 lltst.c -fverbose-asm -S 

The source file is:

int equ(unsigned long long rc)
{
         if ((rc & 0x00000000ffffffffULL) == 0x00000000ULL)
                 return 1;

         return 0;
}

The assembler code generated is such that the result of the "equ" function
depends on the high part of the argument while it shouldn't:

equ:
        .frame  $sp,0,$31               # vars= 0, regs= 0/0, args= 0, gp= 0
        .mask   0x00000000,0
        .fmask  0x00000000,0
        .set    noreorder
        .set    nomacro

        j       $31
        sltu    $2,$4,1  # <result>, rc

        .set    macro
        .set    reorder
        .end    equ

It seems that the wrong code is produced after the "combine" RTL pass.


-- 
           Summary: Wrong code for a function with long long argument
                    returning int.
           Product: gcc
           Version: 4.1.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: niva at niisi dot msk dot ru
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: mips64-none-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38469


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

end of thread, other threads:[~2008-12-20 21:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-10 10:27 [Bug c/38469] New: Wrong code for a function with long long argument returning int niva at niisi dot msk dot ru
2008-12-15 21:43 ` [Bug c/38469] " rsandifo at gcc dot gnu dot org
2008-12-18 10:48 ` [Bug target/38469] " niva at niisi dot msk dot ru
2008-12-20 21:36 ` rsandifo 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).