public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/66757] New: wrong code at -O1 and above on x86_64-linux-gnu
@ 2015-07-03 22:11 su at cs dot ucdavis.edu
  2015-07-05 12:20 ` [Bug rtl-optimization/66757] " ebotcazou at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: su at cs dot ucdavis.edu @ 2015-07-03 22:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66757
           Summary: wrong code at -O1 and above on x86_64-linux-gnu
           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 both 32-bit and 64-bit modes. 

This is a regression from 5.1.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/6.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 6.0.0 20150703 (experimental) [trunk revision 225367] (GCC) 
$ 
$ gcc-trunk -O0 small.c; ./a.out
$ gcc-5.1 -O1 small.c; ./a.out
$ 
$ gcc-trunk -O1 small.c
$ ./a.out
Aborted (core dumped)
$ 


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


int a, b;

int
main ()
{
  unsigned int t = (unsigned char) (~b); 

  if ((t ^ 1) / 255)
    __builtin_abort (); 

  return 0;
}


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

* [Bug rtl-optimization/66757] wrong code at -O1 and above on x86_64-linux-gnu
  2015-07-03 22:11 [Bug rtl-optimization/66757] New: wrong code at -O1 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
@ 2015-07-05 12:20 ` ebotcazou at gcc dot gnu.org
  2015-07-05 12:21 ` [Bug tree-optimization/66757] " ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-07-05 12:20 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-07-05
                 CC|                            |ebotcazou at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Confirmed, forwprop1 going awry because of the match.pd:444 pattern.


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

* [Bug tree-optimization/66757] wrong code at -O1 and above on x86_64-linux-gnu
  2015-07-03 22:11 [Bug rtl-optimization/66757] New: wrong code at -O1 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
  2015-07-05 12:20 ` [Bug rtl-optimization/66757] " ebotcazou at gcc dot gnu.org
@ 2015-07-05 12:21 ` ebotcazou at gcc dot gnu.org
  2015-07-05 18:17 ` [Bug tree-optimization/66757] [6 Regression] " hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-07-05 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
          Component|rtl-optimization            |tree-optimization
           Assignee|unassigned at gcc dot gnu.org      |ebotcazou at gcc dot gnu.org

--- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Testing obvious fix.


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

* [Bug tree-optimization/66757] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu
  2015-07-03 22:11 [Bug rtl-optimization/66757] New: wrong code at -O1 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
  2015-07-05 12:20 ` [Bug rtl-optimization/66757] " ebotcazou at gcc dot gnu.org
  2015-07-05 12:21 ` [Bug tree-optimization/66757] " ebotcazou at gcc dot gnu.org
@ 2015-07-05 18:17 ` hjl.tools at gmail dot com
  2015-07-06  8:44 ` ebotcazou at gcc dot gnu.org
  2015-07-06  8:48 ` ebotcazou at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2015-07-05 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

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


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

* [Bug tree-optimization/66757] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu
  2015-07-03 22:11 [Bug rtl-optimization/66757] New: wrong code at -O1 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2015-07-05 18:17 ` [Bug tree-optimization/66757] [6 Regression] " hjl.tools at gmail dot com
@ 2015-07-06  8:44 ` ebotcazou at gcc dot gnu.org
  2015-07-06  8:48 ` ebotcazou at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-07-06  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Author: ebotcazou
Date: Mon Jul  6 08:43:58 2015
New Revision: 225446

URL: https://gcc.gnu.org/viewcvs?rev=225446&root=gcc&view=rev
Log:
        PR tree-optimization/66757
        * match.pd: Add missing condition to ~X ^ C -> X ^ ~C.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr66757.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/match.pd
    trunk/gcc/testsuite/ChangeLog


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

* [Bug tree-optimization/66757] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu
  2015-07-03 22:11 [Bug rtl-optimization/66757] New: wrong code at -O1 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
                   ` (3 preceding siblings ...)
  2015-07-06  8:44 ` ebotcazou at gcc dot gnu.org
@ 2015-07-06  8:48 ` ebotcazou at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2015-07-06  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

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

--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Thanks for reporting the problem.


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

end of thread, other threads:[~2015-07-06  8:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-03 22:11 [Bug rtl-optimization/66757] New: wrong code at -O1 and above on x86_64-linux-gnu su at cs dot ucdavis.edu
2015-07-05 12:20 ` [Bug rtl-optimization/66757] " ebotcazou at gcc dot gnu.org
2015-07-05 12:21 ` [Bug tree-optimization/66757] " ebotcazou at gcc dot gnu.org
2015-07-05 18:17 ` [Bug tree-optimization/66757] [6 Regression] " hjl.tools at gmail dot com
2015-07-06  8:44 ` ebotcazou at gcc dot gnu.org
2015-07-06  8:48 ` ebotcazou at gcc dot gnu.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).