This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Likely egcs snapshot bug


David Edelsohn <dje@watson.ibm.com> writes:

  	I can help debug this, but I think that you really should report
  this to the main egcs mailinglist so that Jeff Law knows about this for
  his release decisions.  I do not know of any general codegen problems
  remaining.  Is your failure for 32-bit or 64-bit?  The only significant,
  chronic bug is structure alignment because of the screwed up GCC
  MUST_PASS_IN_STRUCT test where it aligns contrary to the ABI.
  
The problem I brought up initially had actually disappeared with the latest
snapshot, but a mistake on my part made it seem to prevail.  But the `make
check' in GMP still doesn't run to completion.  I nailed the new problem
down to this test case:

    #include <stdio.h>
    union ieee_double_extract
    {
      struct
        {
          unsigned int sig:1;
          unsigned int exp:11;
          unsigned int manh:20;
          unsigned int manl:32;
        } s;
      double d;
    };
    double
    foo (double d, int exp)
    {
      union ieee_double_extract x;
      x.d = d;
      x.s.exp += exp;
      return x.d;
    }
    int
    main ()
    {
      printf ("%f\n", foo (1.0, 10));
      return 0;
    }

Compile with -O -maix64.  It prints 1.000000 instead of the expected
1024.000000.  Without optimization the program works correctly.

-- 
Torbjörn


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]