public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61682] New: wrong code at -O3 on x86_64-linux-gnu
@ 2014-07-02 23:37 su at cs dot ucdavis.edu
  2014-07-03  6:22 ` [Bug tree-optimization/61682] [4.10 Regression] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-07-02 23:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61682
           Summary: wrong code at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The current gcc trunk miscompiles the following testcase on x86_64-linux at -O3
in both 32-bit and 64-bit modes.  

This is a regression from 4.9.x.  

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-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 4.10.0 20140702 (experimental) [trunk revision 212218] (GCC) 
$ 
$ gcc-trunk -O2 small.c; a.out
$ gcc-4.9 -O3 small.c; a.out
$ 
$ gcc-trunk -O3 small.c       
$ a.out
Aborted (core dumped)
$ 

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

int a, b;
static int *c = &b;

int
main ()
{
  int *d = &a;
  for (a = 0; a < 12; a++)
    *c |= *d / 9;

  if (b != 1) 
    __builtin_abort (); 

  return 0;
}


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

* [Bug tree-optimization/61682] [4.10 Regression] wrong code at -O3 on x86_64-linux-gnu
  2014-07-02 23:37 [Bug tree-optimization/61682] New: wrong code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
@ 2014-07-03  6:22 ` jakub at gcc dot gnu.org
  2014-07-03 22:12 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-03  6:22 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-07-03
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |4.10.0
            Summary|wrong code at -O3 on        |[4.10 Regression] wrong
                   |x86_64-linux-gnu            |code at -O3 on
                   |                            |x86_64-linux-gnu
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r210113.


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

* [Bug tree-optimization/61682] [4.10 Regression] wrong code at -O3 on x86_64-linux-gnu
  2014-07-02 23:37 [Bug tree-optimization/61682] New: wrong code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-07-03  6:22 ` [Bug tree-optimization/61682] [4.10 Regression] " jakub at gcc dot gnu.org
@ 2014-07-03 22:12 ` jakub at gcc dot gnu.org
  2014-07-03 22:20 ` jakub at gcc dot gnu.org
  2014-07-05 15:01 ` andi-gcc at firstfloor dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-03 22:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Thu Jul  3 22:11:21 2014
New Revision: 212273

URL: https://gcc.gnu.org/viewcvs?rev=212273&root=gcc&view=rev
Log:
    PR tree-optimization/61682
    * wide-int.cc (wi::mul_internal): Handle high correctly
    for umul_ppmm using cases and when one of the operands is
    equal to 1.

    * gcc.c-torture/execute/pr61682.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr61682.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/wide-int.cc


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

* [Bug tree-optimization/61682] [4.10 Regression] wrong code at -O3 on x86_64-linux-gnu
  2014-07-02 23:37 [Bug tree-optimization/61682] New: wrong code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-07-03  6:22 ` [Bug tree-optimization/61682] [4.10 Regression] " jakub at gcc dot gnu.org
  2014-07-03 22:12 ` jakub at gcc dot gnu.org
@ 2014-07-03 22:20 ` jakub at gcc dot gnu.org
  2014-07-05 15:01 ` andi-gcc at firstfloor dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-03 22:20 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

* [Bug tree-optimization/61682] [4.10 Regression] wrong code at -O3 on x86_64-linux-gnu
  2014-07-02 23:37 [Bug tree-optimization/61682] New: wrong code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2014-07-03 22:20 ` jakub at gcc dot gnu.org
@ 2014-07-05 15:01 ` andi-gcc at firstfloor dot org
  3 siblings, 0 replies; 5+ messages in thread
From: andi-gcc at firstfloor dot org @ 2014-07-05 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

Andi Kleen <andi-gcc at firstfloor dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andi-gcc at firstfloor dot org

--- Comment #5 from Andi Kleen <andi-gcc at firstfloor dot org> ---
There may be more bugs in this area.

For LTO builds depending how the compiler inlines there are several "may be
uniniitialized" errors in wide-int.h. Each of them could be a similar problem.


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

end of thread, other threads:[~2014-07-05 15:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 23:37 [Bug tree-optimization/61682] New: wrong code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
2014-07-03  6:22 ` [Bug tree-optimization/61682] [4.10 Regression] " jakub at gcc dot gnu.org
2014-07-03 22:12 ` jakub at gcc dot gnu.org
2014-07-03 22:20 ` jakub at gcc dot gnu.org
2014-07-05 15:01 ` andi-gcc at firstfloor dot org

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