public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/58387] New: wrong code at -Os and above on x86_64-linux-gnu (both 32-bit and 64-bit modes)
@ 2013-09-10 23:10 su at cs dot ucdavis.edu
  2013-09-11  5:17 ` [Bug middle-end/58387] " jakub at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: su at cs dot ucdavis.edu @ 2013-09-10 23:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58387
           Summary: wrong code at -Os and above on x86_64-linux-gnu (both
                    32-bit and 64-bit modes)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The current gcc trunk produces wrong code for the attached testcase on
x86_64-linux-gnu when compiled at -Os and above in both 32-bit and 64-bit
modes. 

It is a regression from 4.8.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.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure
--enable-languages=c,c++,objc,obj-c++,fortran,lto
--with-gmp=/usr/local/gcc-trunk --with-mpfr=/usr/local/gcc-trunk
--with-mpc=/usr/local/gcc-trunk --with-cloog=/usr/local/gcc-trunk
--prefix=/usr/local/gcc-trunk
Thread model: posix
gcc version 4.9.0 20130910 (experimental) [trunk revision 202421] (GCC) 
$ gcc-trunk -O1 small.c
$ a.out
$ gcc-4.8 -O2 small.c
$ a.out
$ gcc-trunk -Os small.c
$ a.out
0
$ 


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

int printf (const char *, ...);

int a = -1; 

int main ()
{
  int b = a == 0 ? 0 : -a;
  if (b < 1)
    printf ("%d\n", 0);
  return 0;
}


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

end of thread, other threads:[~2013-09-17 18:39 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-10 23:10 [Bug middle-end/58387] New: wrong code at -Os and above on x86_64-linux-gnu (both 32-bit and 64-bit modes) su at cs dot ucdavis.edu
2013-09-11  5:17 ` [Bug middle-end/58387] " jakub at gcc dot gnu.org
2013-09-11  5:22 ` su at cs dot ucdavis.edu
2013-09-11  6:13 ` jakub at gcc dot gnu.org
2013-09-11  7:10 ` su at cs dot ucdavis.edu
2013-09-11 15:04 ` su at cs dot ucdavis.edu
2013-09-11 16:50 ` [Bug middle-end/58387] [4.9 Regression] " hjl.tools at gmail dot com
2013-09-12 21:19 ` hjl.tools at gmail dot com
2013-09-12 21:29 ` law at redhat dot com
2013-09-13  3:35 ` law at redhat dot com
2013-09-13  6:02 ` law at redhat dot com
2013-09-13  7:10 ` su at cs dot ucdavis.edu
2013-09-13 11:10 ` markus at trippelsdorf dot de
2013-09-13 15:28 ` law at redhat dot com
2013-09-13 15:48 ` su at cs dot ucdavis.edu
2013-09-13 16:02 ` law at redhat dot com
2013-09-13 16:25 ` joseph at codesourcery dot com
2013-09-13 16:33 ` law at redhat dot com
2013-09-13 17:31 ` glisse at gcc dot gnu.org
2013-09-13 18:00 ` law at redhat dot com
2013-09-13 19:18 ` glisse at gcc dot gnu.org
2013-09-17 18:39 ` law at redhat 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).