public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/30643]  New: CSE regression
@ 2007-01-30 17:07 dann at godzilla dot ics dot uci dot edu
  2007-02-13 20:37 ` [Bug rtl-optimization/30643] " janis at gcc dot gnu dot org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2007-01-30 17:07 UTC (permalink / raw)
  To: gcc-bugs

CSE used to eliminate all the "if"s in the code below at least in gcc-3.x (and
probably even earlier). Now in SVN HEAD it does not do it anymore. 4.1 still
does it. 

struct s {  int a;  int b;};
void bar (struct s *ps,  int *p, int *__restrict__ rp, int *__restrict__ rq)
{
  ps->a = 0;
  ps->b = 1;
  if (ps->a != 0)    abort ();
  p[0] = 0;
  p[1] = 1;
  if (p[0] != 0)     abort ();
  rp[0] = 0;
  rq[0] = 1;
  if (rp[0] != 0)     abort();
}

-O2 assembly for SVN HEAD:
bar:
        subl    $12, %esp
        movl    16(%esp), %eax
        movl    20(%esp), %edx
        movl    24(%esp), %ecx
        movl    $0, (%eax)
        movl    $1, 4(%eax)
        movl    (%eax), %eax
        testl   %eax, %eax
        jne     .L20
        movl    $0, (%edx)
        movl    (%edx), %eax
        movl    $1, 4(%edx)
        testl   %eax, %eax
        jne     .L20
        movl    $0, (%ecx)
        movl    (%ecx), %ecx
        movl    28(%esp), %eax
        testl   %ecx, %ecx
        movl    $1, (%eax)
        jne     .L20
        addl    $12, %esp
        ret
.L20:
        call    abort


-O2 assembly for 4.1.1
bar:
        movl    4(%esp), %eax
        movl    8(%esp), %edx
        movl    $0, (%eax)
        movl    $1, 4(%eax)
        movl    12(%esp), %eax
        movl    $0, (%edx)
        movl    $1, 4(%edx)
        movl    $0, (%eax)
        movl    16(%esp), %eax
        movl    $1, (%eax)
        ret


-- 
           Summary: CSE regression
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu


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


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

end of thread, other threads:[~2007-03-13  7:31 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-30 17:07 [Bug rtl-optimization/30643] New: CSE regression dann at godzilla dot ics dot uci dot edu
2007-02-13 20:37 ` [Bug rtl-optimization/30643] " janis at gcc dot gnu dot org
2007-02-20 22:31 ` [Bug rtl-optimization/30643] [4.2/4.3 Regression] " rguenth at gcc dot gnu dot org
2007-02-21 20:49 ` [Bug rtl-optimization/30643] [4.1/4.2/4.3 " jakub at gcc dot gnu dot org
2007-03-05  3:37 ` mmitchel at gcc dot gnu dot org
2007-03-05  7:22 ` ebotcazou at gcc dot gnu dot org
2007-03-08  9:05 ` [Bug rtl-optimization/30643] [4.1/4.2/4.3 regression] CSE pessimization aoliva at gcc dot gnu dot org
2007-03-08 10:23 ` aoliva at gcc dot gnu dot org
2007-03-08 11:39 ` ebotcazou at gcc dot gnu dot org
2007-03-09  6:50 ` patchapp at dberlin dot org
2007-03-09  8:44 ` bonzini at gnu dot org
2007-03-09  8:54 ` rakdver at gcc dot gnu dot org
2007-03-09 12:41 ` patchapp at dberlin dot org
2007-03-09 20:13 ` aoliva at gcc dot gnu dot org
2007-03-09 23:30 ` aoliva at gcc dot gnu dot org
2007-03-09 23:30 ` aoliva at gcc dot gnu dot org
2007-03-09 23:36 ` aoliva at gcc dot gnu dot org
2007-03-13  7:31 ` patchapp at dberlin dot 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).