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; 16+ 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] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
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 ` rguenth at gcc dot gnu dot org
2005-08-11 15:29 ` pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-08-11 15:21 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.0.2
Known to work| |4.1.0
Target Milestone|--- |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
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
` (10 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-11 15:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-11 15:29 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-08-11 15:29:17
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
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
` (9 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-11 15:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-11 15:51 -------
Oh, this is truely fixed for 4.1 and not a latent bug there.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (2 preceding siblings ...)
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
` (8 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-11 16:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-11 16:03 -------
Created an attachment (id=9474)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9474&action=view)
Patch which fixes but needs testing
This patch fixes the problem by continuing if we don't have a SSA_NAME or
zero/one in the conditional.
Richard if you could test this for me, that would be nice.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (3 preceding siblings ...)
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
` (7 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: rguenth at tat dot physik dot uni-tuebingen dot de @ 2005-08-11 17:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2005-08-11 17:43 -------
I'll do that. Though
+ /* If we don't have <NE_EXPR/NE_EXPR x INT_CST>, then we cannot
+ optimize this case. */
+ if ((cond_code == NE_EXPR || cond_code == EQ_EXPR)
+ && TREE_CODE (TREE_OPERAND (cond, 1)) != INTEGER_CST)
+ continue;
should probably read
+ /* If we don't have <NE_EXPR/EQ_EXPR x INT_CST>, then we cannot
+ optimize this case. */
+ if (!((cond_code == NE_EXPR || cond_code == EQ_EXPR)
+ && TREE_CODE (TREE_OPERAND (cond, 1)) == INTEGER_CST))
+ continue;
because else we might get f.i. LE_EXPR passing through? Maybe the little
context confuses me here, though.
I'll have a look before testing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (4 preceding siblings ...)
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
` (6 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: pinskia at physics dot uc dot edu @ 2005-08-11 17:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at physics dot uc dot edu 2005-08-11 17:45 -------
Subject: Re: [4.0 Regression] Wrong code from forwprop
On Aug 11, 2005, at 1:43 PM, rguenth at tat dot physik dot
uni-tuebingen dot de wrote:
> because else we might get f.i. LE_EXPR passing through? Maybe the
> little
> context confuses me here, though.
We will never get LE_EXPR here as this is always a boolean type.
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (5 preceding siblings ...)
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
` (5 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-08-11 18:05 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From belyshev at depni dot sinp dot msu dot ru 2005-08-11 18:05 -------
// self-contained C++ testcase, compile with -O2
extern "C" void abort (void);
int j;
void foo (bool x, bool y)
{
if (!x)
j = 0;
if (!x == y)
j = 1;
}
int main (void)
{
foo (1, 1);
if (j)
abort ();
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (6 preceding siblings ...)
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
` (4 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-08-12 10:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-12 10:57 -------
Patch posted.
--
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2005-
| |08/msg00738.html
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (7 preceding siblings ...)
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
` (3 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-22 12:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-22 12:15 -------
*** Bug 23512 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mec at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (8 preceding siblings ...)
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
` (2 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: matz at suse dot de @ 2005-09-01 15:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From matz at suse dot de 2005-09-01 15:11 -------
This still isn't in the 4.0 branch. Perhaps ping it?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (9 preceding siblings ...)
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
12 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-09-01 15:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-09-01 15:18 -------
It's in the tracker and I pinged it once already. One could commit it as
obvious, though ;)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (10 preceding siblings ...)
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
12 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-09-03 19:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-09-03 19:55 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
2005-08-11 15:20 [Bug tree-optimization/23326] New: [4.0 Regression] Wrong code from forwprop rguenth at gcc dot gnu dot org
` (11 preceding siblings ...)
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
12 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-03 19:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-09-03 19:55 -------
Subject: Bug 23326
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-4_0-branch
Changes by: rguenth@gcc.gnu.org 2005-09-03 19:54:51
Modified files:
gcc : ChangeLog tree-ssa-forwprop.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/tree-ssa: pr23326.C
Log message:
2005-09-03 Richard Guenther <rguenther@suse.de>
Andrew Pinski <pinskia@gcc.gnu.org>
Serge Belyshev <belyshev@depni.sinp.msu.ru>
PR tree-optimization/23326
* tree-ssa-forwprop.c (substitute_single_use_vars): Only
do transformation if valid.
* g++.dg/tree-ssa/pr23326.C: New testcase.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.409&r2=2.7592.2.410
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-forwprop.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.11&r2=2.11.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.372&r2=1.5084.2.373
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/tree-ssa/pr23326.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
[not found] <bug-23326-10053@http.gcc.gnu.org/bugzilla/>
2005-11-08 16:44 ` pinskia at gcc dot gnu dot org
@ 2006-05-17 19:17 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-17 19:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from pinskia at gcc dot gnu dot org 2006-05-17 19:17 -------
*** Bug 27647 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |scharest at druide dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/23326] [4.0 Regression] Wrong code from forwprop
[not found] <bug-23326-10053@http.gcc.gnu.org/bugzilla/>
@ 2005-11-08 16:44 ` pinskia at gcc dot gnu dot org
2006-05-17 19:17 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-08 16:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from pinskia at gcc dot gnu dot org 2005-11-08 16:44 -------
*** Bug 24737 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fredrik dot littmarck at
| |propellerheads dot se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23326
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2006-05-17 19:17 UTC | newest]
Thread overview: 16+ 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
[not found] <bug-23326-10053@http.gcc.gnu.org/bugzilla/>
2005-11-08 16:44 ` pinskia at gcc dot gnu dot org
2006-05-17 19:17 ` pinskia 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).