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 target/70333] New: [5/6 Regression] Test miscompiled with -O0.


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70333

            Bug ID: 70333
           Summary: [5/6 Regression] Test miscompiled with -O0.
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vsevolod.livinskij at frtk dot ru
  Target Milestone: ---

Created attachment 38042
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38042&action=edit
Reproducer.

Test case produces incorrect result with -O0. It also fails with gcc version
5.3.1 20160318 (Revision=234347) and works fine with gcc version 4.9.4 20160318
(prerelease) (Revision=234347)

GCC version:
> g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/export/users/vlivinsk/gcc-trunk/bin/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /export/users/vlivinsk/gcc-trunk/gcc/configure
--with-arch=corei7 --with-cpu=corei7 --enable-clocale=gnu --with-system-zlib
--enable-shared --with-demangler-in-ld --enable-cloog-backend=isl
--with-fpmath=sse --enable-checking=release --enable-languages=c,c++,lto
--with-gmp=/export/users/vlivinsk/gcc-trunk/gmp-6.1.0/bin
--with-mpfr=/export/users/vlivinsk/gcc-trunk/mpfr-3.1.3/bin
--with-mpc=/export/users/vlivinsk/gcc-trunk/mpc-1.0.3/bin
--prefix=/export/users/vlivinsk/gcc-trunk/bin
Thread model: posix
gcc version 6.0.0 20160319 (experimental) (Revision=234350)

Test:
#include <iostream>

signed char a = -33;
signed char b = -60;
signed char c = 70;
long int d = 8591990532774389055L;

void foo () {
    signed char e = ((unsigned long int)a < (unsigned long int)8) == (a > c);
    d = ((2UL * b) * (e * 13)) * (32 << 24);
}

int main () {
    foo ();
    if (d != -837518622720)
        abort();
    return 0;
}

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