public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/47155] New: likely wrong code bug
@ 2011-01-03  3:01 regehr at cs dot utah.edu
  2011-01-03  9:13 ` [Bug tree-optimization/47155] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: regehr at cs dot utah.edu @ 2011-01-03  3:01 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: likely wrong code bug
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu
                CC: chenyang@cs.utah.edu


[regehr@gamow tmp438]$ current-gcc -O0 small.c -o small
[regehr@gamow tmp438]$ ./small
1
[regehr@gamow tmp438]$ current-gcc -O1 small.c -o small
[regehr@gamow tmp438]$ ./small
0
[regehr@gamow tmp438]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r168402-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r168402-install
--program-prefix=r168402- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20110102 (experimental) (GCC) 
[regehr@gamow tmp438]$ cat small.c


static unsigned int g_1;
static signed char g_2 = 0x81;

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

static unsigned char foo(unsigned char p1, unsigned char p2)
{
    return p1 * p2;
}

int main (void)
{
    int l_5[2];
    int i;
    for (i = 0; i < 2; i++)
        l_5[i] = 1;
    g_1 = g_2 <= foo(-6, l_5[0]);

    printf("%u\n", g_1);
    return 0;
}


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

* [Bug tree-optimization/47155] likely wrong code bug
  2011-01-03  3:01 [Bug c/47155] New: likely wrong code bug regehr at cs dot utah.edu
@ 2011-01-03  9:13 ` jakub at gcc dot gnu.org
  2011-01-03  9:31 ` [Bug tree-optimization/47155] [4.6 Regression] ccp caused miscompilation jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-03  9:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.01.03 09:13:19
                 CC|                            |jakub at gcc dot gnu.org
          Component|c                           |tree-optimization
   Target Milestone|---                         |4.6.0
     Ever Confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-03 09:13:19 UTC ---
Indeed, caused by my PR47140 patch.


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

* [Bug tree-optimization/47155] [4.6 Regression] ccp caused miscompilation
  2011-01-03  3:01 [Bug c/47155] New: likely wrong code bug regehr at cs dot utah.edu
  2011-01-03  9:13 ` [Bug tree-optimization/47155] " jakub at gcc dot gnu.org
@ 2011-01-03  9:31 ` jakub at gcc dot gnu.org
  2011-01-03 21:01 ` jakub at gcc dot gnu.org
  2011-01-03 21:12 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-03  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-03 09:31:27 UTC ---
Created attachment 22884
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22884
gcc46-pr47155.patch

Untested fix.


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

* [Bug tree-optimization/47155] [4.6 Regression] ccp caused miscompilation
  2011-01-03  3:01 [Bug c/47155] New: likely wrong code bug regehr at cs dot utah.edu
  2011-01-03  9:13 ` [Bug tree-optimization/47155] " jakub at gcc dot gnu.org
  2011-01-03  9:31 ` [Bug tree-optimization/47155] [4.6 Regression] ccp caused miscompilation jakub at gcc dot gnu.org
@ 2011-01-03 21:01 ` jakub at gcc dot gnu.org
  2011-01-03 21:12 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-03 21:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-03 21:01:18 UTC ---
Author: jakub
Date: Mon Jan  3 21:01:14 2011
New Revision: 168440

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168440
Log:
    PR tree-optimization/47155
    * tree-ssa-ccp.c (bit_value_binop_1): Use r1type instead of type
    when computing uns.

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

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr47155.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-ccp.c


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

* [Bug tree-optimization/47155] [4.6 Regression] ccp caused miscompilation
  2011-01-03  3:01 [Bug c/47155] New: likely wrong code bug regehr at cs dot utah.edu
                   ` (2 preceding siblings ...)
  2011-01-03 21:01 ` jakub at gcc dot gnu.org
@ 2011-01-03 21:12 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-03 21:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-03 21:12:02 UTC ---
Fixed.


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

end of thread, other threads:[~2011-01-03 21:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-03  3:01 [Bug c/47155] New: likely wrong code bug regehr at cs dot utah.edu
2011-01-03  9:13 ` [Bug tree-optimization/47155] " jakub at gcc dot gnu.org
2011-01-03  9:31 ` [Bug tree-optimization/47155] [4.6 Regression] ccp caused miscompilation jakub at gcc dot gnu.org
2011-01-03 21:01 ` jakub at gcc dot gnu.org
2011-01-03 21:12 ` jakub 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).