public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/68011] New: wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode
@ 2015-10-19  0:12 su at cs dot ucdavis.edu
  2015-10-19 10:00 ` [Bug rtl-optimization/68011] [6 Regression] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: su at cs dot ucdavis.edu @ 2015-10-19  0:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 68011
           Summary: wrong code at -O1 and above on x86_64-linux-gnu in
                    64-bit mode
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The current gcc trunk mis-compiles the following code on x86_64-linux-gnu at
-O1 and above in the 64-bit mode (but not in the 32-bit mode). 

This is a regression from 5.2.x.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20151018 (experimental) [trunk revision 228953] (GCC) 
$ 
$ gcc-trunk -m64 -O0 small.c; ./a.out
$ gcc-trunk -m32 -O1 small.c; ./a.out
$ gcc-5.2 -m64 -O1 small.c; ./a.out
$ 
$ gcc-trunk -m64 -O1 small.c
$ ./a.out
Aborted (core dumped)
$ 


------------------------------


struct S
{
  int f0;
  int f1;
  int f2;
  short f3;
  int f4:1;
} a, c = {0, 0, 1, 0, 0};

int d;

int
main ()
{
  struct S e = c;
  e.f0++;
  d = e.f3;
  a = e;

  if (a.f2 != 1)
    __builtin_abort ();

  return 0;
}


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

* [Bug rtl-optimization/68011] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode
  2015-10-19  0:12 [Bug rtl-optimization/68011] New: wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode su at cs dot ucdavis.edu
@ 2015-10-19 10:00 ` rguenth at gcc dot gnu.org
  2015-10-19 11:03 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-19 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |6.0
            Summary|wrong code at -O1 and above |[6 Regression] wrong code
                   |on x86_64-linux-gnu in      |at -O1 and above on
                   |64-bit mode                 |x86_64-linux-gnu in 64-bit
                   |                            |mode


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

* [Bug rtl-optimization/68011] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode
  2015-10-19  0:12 [Bug rtl-optimization/68011] New: wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode su at cs dot ucdavis.edu
  2015-10-19 10:00 ` [Bug rtl-optimization/68011] [6 Regression] " rguenth at gcc dot gnu.org
@ 2015-10-19 11:03 ` mpolacek at gcc dot gnu.org
  2015-10-19 11:04 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-10-19 11:03 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-19
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r225852.


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

* [Bug rtl-optimization/68011] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode
  2015-10-19  0:12 [Bug rtl-optimization/68011] New: wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode su at cs dot ucdavis.edu
  2015-10-19 10:00 ` [Bug rtl-optimization/68011] [6 Regression] " rguenth at gcc dot gnu.org
  2015-10-19 11:03 ` mpolacek at gcc dot gnu.org
@ 2015-10-19 11:04 ` mpolacek at gcc dot gnu.org
  2015-10-19 13:56 ` rguenth at gcc dot gnu.org
  2015-10-19 18:46 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-10-19 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
So likely a target bug.


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

* [Bug rtl-optimization/68011] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode
  2015-10-19  0:12 [Bug rtl-optimization/68011] New: wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2015-10-19 11:04 ` mpolacek at gcc dot gnu.org
@ 2015-10-19 13:56 ` rguenth at gcc dot gnu.org
  2015-10-19 18:46 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-19 13:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Possibly a dup of that reload/LRA issue


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

* [Bug rtl-optimization/68011] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode
  2015-10-19  0:12 [Bug rtl-optimization/68011] New: wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode su at cs dot ucdavis.edu
                   ` (3 preceding siblings ...)
  2015-10-19 13:56 ` rguenth at gcc dot gnu.org
@ 2015-10-19 18:46 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2015-10-19 18:46 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #3)
> Possibly a dup of that reload/LRA issue

Exactly.

We start with:

(insn 18 17 19 2 (parallel [
            (set (subreg:DI (reg/v:TI 92 [ e ]) 0)
                (ior:DI (reg:DI 100)
                    (reg:DI 98 [ _3 ])))
            (clobber (reg:CC 17 flags))
        ]) pr68011.c:18 398 {*iordi_1}
     (expr_list:REG_DEAD (reg:DI 100)
        (expr_list:REG_DEAD (reg:DI 98 [ _3 ])
            (expr_list:REG_UNUSED (reg:CC 17 flags)
                (nil)))))
(insn 19 18 21 2 (set (reg:V8HI 103)
        (vec_merge:V8HI (vec_duplicate:V8HI (reg:HI 91 [ e$12 ]))
            (subreg:V8HI (reg/v:TI 92 [ e ]) 0)
            (const_int 64 [0x40]))) pr68011.c:18 3597 {sse2_pinsrw}

and reload generates (insn 41) that clears high word:

(insn 18 39 40 2 (parallel [
            (set (reg:DI 0 ax [100])
                (ior:DI (reg:DI 0 ax [100])
                    (reg:DI 2 cx [orig:98 _3 ] [98])))
            (clobber (reg:CC 17 flags))
        ]) pr68011.c:18 398 {*iordi_1}
     (nil))

...

(insn 41 40 19 2 (set (reg:DI 21 xmm0 [orig:92 e ] [92])
        (mem/c:DI (plus:DI (reg/f:DI 7 sp)
                (const_int 8 [0x8])) [0 %sfp+-8 S8 A64])) pr68011.c:18 85
{*movdi_internal}
     (nil))
(insn 19 41 21 2 (set (reg:V8HI 21 xmm0 [103])
        (vec_merge:V8HI (vec_duplicate:V8HI (reg:HI 1 dx [orig:91 e$12 ] [91]))
            (reg:V8HI 21 xmm0 [orig:92 e ] [92])
            (const_int 64 [0x40]))) pr68011.c:18 3597 {sse2_pinsrw}

*** This bug has been marked as a duplicate of bug 67124 ***
>From gcc-bugs-return-499965-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 19 18:46:18 2015
Return-Path: <gcc-bugs-return-499965-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7770 invoked by alias); 19 Oct 2015 18:46:18 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 7497 invoked by uid 48); 19 Oct 2015 18:46:14 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/67124] [6 Regression] wrong code at -O1, -O2 and -O3 on x86_64-linux-gnu
Date: Mon, 19 Oct 2015 18:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords: ra
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67124-4-w4n23Db1kj@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67124-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67124-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg01520.txt.bz2
Content-length: 185

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

--- Comment #14 from Uroš Bizjak <ubizjak at gmail dot com> ---
*** Bug 68011 has been marked as a duplicate of this bug. ***
>From gcc-bugs-return-499966-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 19 19:10:41 2015
Return-Path: <gcc-bugs-return-499966-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 83650 invoked by alias); 19 Oct 2015 19:10:40 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 83464 invoked by uid 48); 19 Oct 2015 19:10:36 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/68021] [6 Regression] ice in rewrite_use_nonlinear_expr with -O3
Date: Mon, 19 Oct 2015 19:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_known_to_work cf_reconfirmed_on component cc everconfirmed short_desc cf_known_to_fail
Message-ID: <bug-68021-4-lICHUJDsh0@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-68021-4@http.gcc.gnu.org/bugzilla/>
References: <bug-68021-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg01521.txt.bz2
Content-length: 1120

https://gcc.gnu.org/bugzilla/show_bug.cgi?idh021

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.9.3, 5.2.0
   Last reconfirmed|                            |2015-10-19
          Component|c++                         |tree-optimization
                 CC|                            |trippels at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|ice in                      |[6 Regression] ice in
                   |rewrite_use_nonlinear_expr  |rewrite_use_nonlinear_expr
                   |with -O3                    |with -O3
      Known to fail|                            |6.0

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Needs -O3:

char a;
int b;
void fn1(char *p1, int p2, int p3) {
  int x;
  for (; b;) {
    for (x = 0; x < p3; x++) {
      *p1 = a;
      p1--;
    }
    p1 += p2;
  }
}


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

end of thread, other threads:[~2015-10-19 18:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-19  0:12 [Bug rtl-optimization/68011] New: wrong code at -O1 and above on x86_64-linux-gnu in 64-bit mode su at cs dot ucdavis.edu
2015-10-19 10:00 ` [Bug rtl-optimization/68011] [6 Regression] " rguenth at gcc dot gnu.org
2015-10-19 11:03 ` mpolacek at gcc dot gnu.org
2015-10-19 11:04 ` mpolacek at gcc dot gnu.org
2015-10-19 13:56 ` rguenth at gcc dot gnu.org
2015-10-19 18:46 ` ubizjak at gmail dot com

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).