public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/30704]  New: Incorrect constant generation for long long
@ 2007-02-05  0:56 danglin at gcc dot gnu dot org
  2007-02-05 10:16 ` [Bug rtl-optimization/30704] " rguenth at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: danglin at gcc dot gnu dot org @ 2007-02-05  0:56 UTC (permalink / raw)
  To: gcc-bugs

The following problem was seen in a testcase under discussion in PR 30634:

# cat yy.c
#include <stdio.h>
double f(void)
{
  long long t = 0x000fffffffffffff;
  double t1;
  __builtin_memcpy(&t1, &t, sizeof(long long));
  return t1;
}
int main()
{
  union
    {
      long long ll;
      double d;
    } u;

  u.d = f ();
  printf ("ll = 0x%llx\n", u.ll);
  return 0;
}

# ../../xgcc -B../../ -O2 -o yy yy.c
# ./yy
ll = 0xffffffff000fffff
# ../../xgcc -B../../ -O0 -o yy yy.c
# ./yy
ll = 0xfffffffffffff
# ../../xgcc -B../../ -v
Reading specs from ../../specs
Target: hppa64-hp-hpux11.00
Configured with: ../gcc/configure --with-gnu-as --with-as=/opt/gnu64/bin/as
--with-ld=/usr/ccs/bin/ld --enable-shared --with-local-prefix=/opt/gnu64
--prefix=/opt/gnu64/gcc/gcc-4.2.0 --host=hppa64-hp-hpux11.00 --disable-nls
--with-gmp=/opt/gnu64/gcc/gcc-4.2.0
Thread model: posix
gcc version 4.2.0 20070123 (prerelease)

The constant 0x000fffffffffffff appears in the assembler output as a
pair of 32-bit .word values.  The values are reversed when the testcase
is compiled at -O2.  This doesn't appear to be a target issue since the
target only defines directives for the output of constants.


-- 
           Summary: Incorrect constant generation for long long
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: danglin at gcc dot gnu dot org
 GCC build triplet: hppa64-hp-hpux11.00
  GCC host triplet: hppa64-hp-hpux11.00
GCC target triplet: hppa64-hp-hpux11.00


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


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

end of thread, other threads:[~2007-04-03 11:33 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-05  0:56 [Bug rtl-optimization/30704] New: Incorrect constant generation for long long danglin at gcc dot gnu dot org
2007-02-05 10:16 ` [Bug rtl-optimization/30704] " rguenth at gcc dot gnu dot org
2007-02-05 19:43 ` [Bug middle-end/30704] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2007-02-19 21:05 ` mmitchel at gcc dot gnu dot org
2007-03-12 20:19 ` dje at gcc dot gnu dot org
2007-03-12 22:21 ` dje at gcc dot gnu dot org
2007-03-12 22:25 ` pinskia at gcc dot gnu dot org
2007-03-12 22:38 ` pinskia at gcc dot gnu dot org
2007-03-12 22:44 ` pinskia at gcc dot gnu dot org
2007-03-12 23:08 ` pinskia at gcc dot gnu dot org
2007-03-12 23:19 ` pinskia at gcc dot gnu dot org
2007-03-12 23:21 ` pinskia at gcc dot gnu dot org
2007-03-13  0:10 ` pinskia at gcc dot gnu dot org
2007-03-13 22:16 ` pinskia at gcc dot gnu dot org
2007-03-14  6:09 ` pinskia at gcc dot gnu dot org
2007-04-02 13:59 ` jakub at gcc dot gnu dot org
2007-04-03  9:06 ` jakub at gcc dot gnu dot org
2007-04-03  9:23 ` jakub at gcc dot gnu dot org
2007-04-03 11:33 ` jakub 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).