This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug tree-optimization/57829] New: Wrong constant folding


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

            Bug ID: 57829
           Summary: Wrong constant folding
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ishiura-compiler at ml dot kwansei.ac.jp

GCC 4.7.2 - 4.9.0 for i686 and x86_64 miscompiles the following code.

    $ cat error.c

    int main (void)
    {
      volatile int k = 1;
      int t = 2 | ( ( k - 1) >> 31 );
      if (t != 2) __builtin_abort();
      return 0;
    }

    $ x86_64-unknown-linux-gnu-gcc-4.9.0 error.c -O1
    $ ./a.out
    Aborted (core dumped)

    $ x86_64-unknown-linux-gnu-gcc-4.9.0 -v
    Using built-in specs.
    COLLECT_GCC=x86_64-unknown-linux-gnu-gcc-4.9.0
   
COLLECT_LTO_WRAPPER=/usr/local/x86_64-tools/gcc-4.9.0/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
    Target: x86_64-unknown-linux-gnu
    Configured with: /home/hassy/gcc/configure
--prefix=/usr/local/x86_64-tools/gcc-4.9.0/
--with-gmp=/usr/local/gmp-5.1.1/ --with-mpfr=/usr/local/mpfr-3.1.2/
--with-mpc=/usr/local/mpc-1.0.1/ --disable-multilib --disable-nls
--enable-languages=c
    Thread model: posix
    gcc version 4.9.0 20130704 (experimental) (GCC)

The status of the other versions are as follows:

    (x86_64)
    GCC-4.7.2 Error
    GCC-4.8.2 (prerelease) OK
    GCC-4.9.0 (experimental) Error

    (i686)
    GCC-4.7.2 Error
    GCC-4.8.2 (prerelease) Error
    GCC-4.9.0 (experimental) Error


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