public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kcc at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/61095] miscompile: tsan is broken in gcc trunk, works in 4.9
Date: Wed, 07 May 2014 12:55:00 -0000	[thread overview]
Message-ID: <bug-61095-4-Iz2TFaLocA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61095-4@http.gcc.gnu.org/bugzilla/>

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

Kostya Serebryany <kcc at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64-*-*                  |
           Priority|P3                          |P1
   Target Milestone|4.10.0                      |---
            Summary|[4.10 Regression] tsan is   |miscompile: tsan is broken
                   |broken in gcc trunk, works  |in gcc trunk, works in 4.9
                   |in 4.9                      |

--- Comment #2 from Kostya Serebryany <kcc at gcc dot gnu.org> ---
fresh gcc optimizes away a piece of code. minimal repro:

int FOO(unsigned long addr) {
    unsigned long *p = (unsigned long*)((addr & 0xffff83fffffffff8UL) * 4);
    unsigned long xxx = (unsigned long)(p + 1);
    return xxx >= 0x3c000000000UL;
}


gcc 4.9: 
/usr/local/gcc-4.9.0/bin/gcc -S z.c -O2  -o -  | grep -A 10 FOO:
FOO:
.LFB0:
        .cfi_startproc
        movabsq $-136339441844232, %rax
        andq    %rax, %rdi
        movabsq $4123168604159, %rax
        leaq    8(,%rdi,4), %rdx
        cmpq    %rax, %rdx
        seta    %al
        movzbl  %al, %eax
        ret


trunk: 
../gcc-inst/bin/gcc -S z.c -O2  -o -  | grep -A 10 FOO:
FOO:
.LFB0:
        .cfi_startproc
        xorl    %eax, %eax
        ret


  parent reply	other threads:[~2014-05-07 12:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 11:16 [Bug sanitizer/61095] New: " kcc at gcc dot gnu.org
2014-05-07 12:03 ` [Bug sanitizer/61095] " kcc at gcc dot gnu.org
2014-05-07 12:50 ` [Bug sanitizer/61095] [4.10 Regression] " rguenth at gcc dot gnu.org
2014-05-07 12:55 ` kcc at gcc dot gnu.org [this message]
2014-05-07 13:04 ` [Bug sanitizer/61095] [4.10 Regression] miscompile: " kcc at gcc dot gnu.org
2014-05-07 13:25 ` rguenth at gcc dot gnu.org
2014-05-07 13:27 ` jakub at gcc dot gnu.org
2014-05-07 13:27 ` rguenth at gcc dot gnu.org
2014-05-07 13:29 ` rguenth at gcc dot gnu.org
2014-05-07 16:28 ` rsandifo at gcc dot gnu.org
2014-05-07 18:01 ` rsandifo at gcc dot gnu.org
2014-05-08  4:35 ` kcc at gcc dot gnu.org
2014-05-08  4:39 ` kcc at gcc dot gnu.org
2014-05-08  7:19 ` kcc at gcc dot gnu.org
2014-05-08  7:34 ` rsandifo at gcc dot gnu.org
2014-05-08  8:01 ` rsandifo at gcc dot gnu.org
2014-05-08 19:29 ` rsandifo at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-61095-4-Iz2TFaLocA@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).