public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/64260] New: wrong code at -O1 on x86_64-linux-gnu
@ 2014-12-11  0:51 su at cs dot ucdavis.edu
  2014-12-11  6:17 ` [Bug tree-optimization/64260] " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-12-11  0:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64260
           Summary: wrong code at -O1 on x86_64-linux-gnu
           Product: gcc
           Version: 5.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 code on x86_64-linux at -O1
(only) 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/5.0.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 5.0.0 20141210 (experimental) [trunk revision 218559] (GCC) 
$  
$ gcc-trunk -O0 small.c; a.out
$ gcc-4.9 -O1 small.c; a.out
$ 
$ gcc-trunk -O1 small.c
$ a.out
Aborted (core dumped)
$ 


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


int a = 1, b;

void
fn1 (char p)
{
  int t = 0;
  for (; b < 1; b++)
    {
      int *s = &a;
      --t && (*s &= p);
      *s &= 1;
    }
}

int
main ()
{
  fn1 (0);

  if (a != 0) 
    __builtin_abort (); 

  return 0;
}


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

* [Bug tree-optimization/64260] wrong code at -O1 on x86_64-linux-gnu
  2014-12-11  0:51 [Bug tree-optimization/64260] New: wrong code at -O1 on x86_64-linux-gnu su at cs dot ucdavis.edu
@ 2014-12-11  6:17 ` mpolacek at gcc dot gnu.org
  2014-12-12 12:44 ` [Bug tree-optimization/64260] [5 Regression] " jakub at gcc dot gnu.org
  2015-01-05  6:38 ` Joost.VandeVondele at mat dot ethz.ch
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-12-11  6:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
-fno-if-conversion helps, so likely a dup of PR64255 / PR63917.


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

* [Bug tree-optimization/64260] [5 Regression] wrong code at -O1 on x86_64-linux-gnu
  2014-12-11  0:51 [Bug tree-optimization/64260] New: wrong code at -O1 on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-12-11  6:17 ` [Bug tree-optimization/64260] " mpolacek at gcc dot gnu.org
@ 2014-12-12 12:44 ` jakub at gcc dot gnu.org
  2015-01-05  6:38 ` Joost.VandeVondele at mat dot ethz.ch
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-12 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Dec 12 12:43:34 2014
New Revision: 218665

URL: https://gcc.gnu.org/viewcvs?rev=218665&root=gcc&view=rev
Log:
    PR rtl-optimization/64255
    * gcc.c-torture/execute/pr64255.c: New test.

    PR rtl-optimization/64260
    * gcc.c-torture/execute/pr64260.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr64255.c
    trunk/gcc/testsuite/gcc.c-torture/execute/pr64260.c
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug tree-optimization/64260] [5 Regression] wrong code at -O1 on x86_64-linux-gnu
  2014-12-11  0:51 [Bug tree-optimization/64260] New: wrong code at -O1 on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-12-11  6:17 ` [Bug tree-optimization/64260] " mpolacek at gcc dot gnu.org
  2014-12-12 12:44 ` [Bug tree-optimization/64260] [5 Regression] " jakub at gcc dot gnu.org
@ 2015-01-05  6:38 ` Joost.VandeVondele at mat dot ethz.ch
  2 siblings, 0 replies; 4+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2015-01-05  6:38 UTC (permalink / raw)
  To: gcc-bugs

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

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |Joost.VandeVondele at mat dot ethz
                   |                            |.ch
         Resolution|---                         |FIXED

--- Comment #4 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
fixed indeed.


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

end of thread, other threads:[~2015-01-05  6:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11  0:51 [Bug tree-optimization/64260] New: wrong code at -O1 on x86_64-linux-gnu su at cs dot ucdavis.edu
2014-12-11  6:17 ` [Bug tree-optimization/64260] " mpolacek at gcc dot gnu.org
2014-12-12 12:44 ` [Bug tree-optimization/64260] [5 Regression] " jakub at gcc dot gnu.org
2015-01-05  6:38 ` Joost.VandeVondele at mat dot ethz.ch

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