public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop
@ 2005-08-11 15:20 rguenth at gcc dot gnu dot org
  2005-08-11 15:21 ` [Bug tree-optimization/23326] " rguenth at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-08-11 15:20 UTC (permalink / raw)
  To: gcc-bugs

The following testcase reduced from Kopete is miscompiled at -O2

struct Bar { bool is() const; int status() const; };

void foobar(void);
void foobar2(void);

void Foo(const Bar& x, const Bar& y)
{
  const bool wasOffline = !x.is();
  const bool isOffline = !y.is();
  if (wasOffline || y.status() == 10)
    foobar();
  if (wasOffline != isOffline)
    foobar2();
}

.t23.mergephi:
<bb 0>:
  D.1589_3 = is (x_2);
  wasOffline_4 = !D.1589_3;
  D.1590_6 = is (y_5);
  isOffline_7 = !D.1590_6;
  if (wasOffline_4) goto <L1>; else goto <L0>;

<L0>:;
  D.1596_10 = status (y_5);
  if (D.1596_10 == 10) goto <L1>; else goto <L5>;

<L1>:;
  foobar ();

<L5>:;
  if (wasOffline_4 != isOffline_7) goto <L6>; else goto <L7>;

<L6>:;
  foobar2 ();

<L7>:;
  return;

.t24.forwprop:
<bb 0>:
  D.1589_3 = is (x_2);
  D.1590_6 = is (y_5);
  isOffline_7 = !D.1590_6;
  if (D.1589_3 == 0) goto <L1>; else goto <L0>;

<L0>:;
  D.1596_10 = status (y_5);
  if (D.1596_10 == 10) goto <L1>; else goto <L5>;

<L1>:;
  foobar ();

<L5>:;
  if (D.1589_3 != 0) goto <L6>; else goto <L7>;

<L6>:;
  foobar2 ();

<L7>:;
  return;

note that the comparison preceding foobar2() is hosed now,
we even don't use isOffline or D.1590 anymore.

-- 
           Summary: [4.0 Regression] Wrong code from forwprop
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,matz at suse dot de


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


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

end of thread, other threads:[~2005-09-03 19:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
2005-08-11 15:21 ` [Bug tree-optimization/23326] " rguenth at gcc dot gnu dot org
2005-08-11 15:29 ` pinskia at gcc dot gnu dot org
2005-08-11 15:51 ` pinskia at gcc dot gnu dot org
2005-08-11 16:03 ` pinskia at gcc dot gnu dot org
2005-08-11 17:43 ` rguenth at tat dot physik dot uni-tuebingen dot de
2005-08-11 17:45 ` pinskia at physics dot uc dot edu
2005-08-11 18:05 ` belyshev at depni dot sinp dot msu dot ru
2005-08-12 10:57 ` rguenth at gcc dot gnu dot org
2005-08-22 12:18 ` pinskia at gcc dot gnu dot org
2005-09-01 15:11 ` matz at suse dot de
2005-09-01 15:18 ` rguenth at gcc dot gnu dot org
2005-09-03 19:55 ` rguenth at gcc dot gnu dot org
2005-09-03 19:55 ` cvs-commit at gcc dot gnu 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).