public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/54985] New: Dom optimization erroneous remove conditional goto.
@ 2012-10-19 10:56 vbyakovl23 at gmail dot com
  2012-10-19 10:58 ` [Bug middle-end/54985] " vbyakovl23 at gmail dot com
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: vbyakovl23 at gmail dot com @ 2012-10-19 10:56 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54985
           Summary: Dom optimization erroneous remove conditional goto.
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vbyakovl23@gmail.com


Attached test case fails if compiled with -O1 and higher.

gcc -O0 -m32  q.c qm.c  ; ./a.out && echo "pass" || echo "FAIL"                 
pass
gcc -g3 -O1 -m32  q.c qm.c  ; ./a.out && echo "pass" || echo "FAIL"             
FAIL

gcc -v
Using built-in specs.
COLLECT_GCC=/export/users/vbyakovl/workspaces/gcc/install-ref/bin/gcc
COLLECT_LTO_WRAPPER=/export/users/vbyakovl/workspaces/gcc/install-ref/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure CFLAGS='-O0 -g3'
--prefix=/export/users/vbyakovl/workspaces/gcc/install-ref --disable-bootstrap
--enable-languages=c,c++,fortran,lto CXXFLAGS='-O0 -g3' : (reconfigured)
../gcc/configure CFLAGS='-O0 -g3'
--prefix=/export/users/vbyakovl/workspaces/gcc/install-ref --disable-bootstrap
CXXFLAGS='-O0 -g3' --enable-languages=c,c++,fortran,lto --no-create
--no-recursion : (reconfigured) ../gcc/configure CFLAGS='-O0 -g3'
--prefix=/export/users/vbyakovl/workspaces/gcc/install-ref --disable-bootstrap
CXXFLAGS='-O0 -g3' --enable-languages=c,c++,fortran,lto --no-create
--no-recursion
Thread model: posix
gcc version 4.8.0 20121015 (experimental) (GCC)

Wrong compilation of a routine

int foo(ST *s, int c)
{
    int first = 1;
    int count = c;
    ST *item = s;
    int a = s->a;
    int x;

    while (count--)
    {  
        x = item->a;
        if (first)
            first = 0;
        else if (x >= a)
            return 1;
        a = x;
        item++;
    }
    return 0;
}

Compiler sets equivalence between ‘x’ and ‘a’ (routine tree-ssa-threadedge.c
/record_temporary_equivalences_from_phis() ) and folds comparison x >= a to
true.


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

end of thread, other threads:[~2012-11-02 20:25 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-19 10:56 [Bug middle-end/54985] New: Dom optimization erroneous remove conditional goto vbyakovl23 at gmail dot com
2012-10-19 10:58 ` [Bug middle-end/54985] " vbyakovl23 at gmail dot com
2012-10-19 10:59 ` vbyakovl23 at gmail dot com
2012-10-19 11:20 ` [Bug tree-optimization/54985] [4.7/4.8 Regression] dom " rguenth at gcc dot gnu.org
2012-10-19 11:26 ` rguenth at gcc dot gnu.org
2012-10-19 13:27 ` law at redhat dot com
2012-10-19 22:01 ` law at redhat dot com
2012-10-23 20:34 ` law at gcc dot gnu.org
2012-10-23 21:23 ` dominiq at lps dot ens.fr
2012-10-23 21:25 ` law at redhat dot com
2012-10-23 21:35 ` dominiq at lps dot ens.fr
2012-10-30  8:32 ` izamyatin at gmail dot com
2012-10-30 15:13 ` [Bug tree-optimization/54985] [4.7 " rguenth at gcc dot gnu.org
2012-10-31  4:10 ` law at redhat dot com
2012-10-31  4:12 ` law at redhat dot com
2012-11-02 20:19 ` law at gcc dot gnu.org
2012-11-02 20:25 ` 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).