public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/13779] New: PPC-darwin Correct initialization of 'long long' with constant
@ 2004-01-20 19:49 fjahanian at apple dot com
  2004-01-20 19:50 ` [Bug middle-end/13779] " fjahanian at apple dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: fjahanian at apple dot com @ 2004-01-20 19:49 UTC (permalink / raw)
  To: gcc-bugs

-mpowerpc64 for PPC has a bug passing constant to a function expecting
'long long'. The MSW is
incorrectly passed to the function. So, in the following code fragment:


void LL(long long);
...
LL(1);

We generate:


_main:
         li r3,1                                <--- bad!
         li r4,1
         b L_LL$stub

Test case:

/* { dg-do compile { target powerpc*-*-darwin* } } */
/* { dg-options "-O2 -force_cpusubtype_ALL -mpowerpc64" } */

int  msw(long long in)
{
  union {
    long long ll;
    int  i[2];
  } ud;
  ud.ll = in;
  return ud.i[0];
}

int main()
{
  return msw(1) != 0;
}

patch is here:  <http://gcc.gnu.org/ml/gcc-patches/2004-01/msg01497.html>

-- 
           Summary: PPC-darwin Correct initialization of 'long long' with
                    constant
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: fjahanian at apple dot com
        ReportedBy: fjahanian at apple dot com
                CC: dje at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot
                    org,pinskia at gcc dot gnu dot org
GCC target triplet: powerpc-*-*


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


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

end of thread, other threads:[~2004-02-10  1:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-20 19:49 [Bug middle-end/13779] New: PPC-darwin Correct initialization of 'long long' with constant fjahanian at apple dot com
2004-01-20 19:50 ` [Bug middle-end/13779] " fjahanian at apple dot com
2004-01-20 20:39 ` pinskia at gcc dot gnu dot org
2004-01-21  7:03 ` [Bug middle-end/13779] powerpc64: incorrect " pinskia at gcc dot gnu dot org
2004-01-21 14:46 ` pinskia at gcc dot gnu dot org
2004-01-21 21:03 ` pinskia at gcc dot gnu dot org
2004-01-26 17:45 ` cvs-commit at gcc dot gnu dot org
2004-01-26 17:48 ` cvs-commit at gcc dot gnu dot org
2004-01-26 17:55 ` fjahanian at apple dot com
2004-01-26 18:12 ` [Bug middle-end/13779] [3.4 only] " pinskia at gcc dot gnu dot org
2004-01-26 18:14 ` lucier at math dot purdue dot edu
2004-01-26 18:28 ` pinskia at gcc dot gnu dot org
2004-01-27 13:05 ` cvs-commit at gcc dot gnu dot org
2004-02-05 11:43 ` cvs-commit at gcc dot gnu dot org
2004-02-10  1:28 ` cvs-commit at gcc dot gnu dot org
2004-02-10  1:47 ` pinskia 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).