* [Bug tree-optimization/19703] Poor optimisation of loop test
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
@ 2005-01-30 3:17 ` pinskia at gcc dot gnu dot org
2005-01-30 3:17 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-30 3:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-30 03:17 -------
(In reply to comment #1)
> Hmm, on most targets it is true that != is the same case as >=.
s/case/cost/.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] Poor optimisation of loop test
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
2005-01-30 3:17 ` [Bug tree-optimization/19703] " pinskia at gcc dot gnu dot org
@ 2005-01-30 3:17 ` pinskia at gcc dot gnu dot org
2005-01-30 4:58 ` andrewhutchinson at cox dot net
` (8 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-30 3:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-30 03:17 -------
Hmm, on most targets it is true that != is the same case as >=.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c |tree-optimization
GCC target triplet| |avr
Keywords| |missed-optimization
Summary|Poor optimisation of loop |Poor optimisation of loop
|test |test
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] Poor optimisation of loop test
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
2005-01-30 3:17 ` [Bug tree-optimization/19703] " pinskia at gcc dot gnu dot org
2005-01-30 3:17 ` pinskia at gcc dot gnu dot org
@ 2005-01-30 4:58 ` andrewhutchinson at cox dot net
2005-01-30 5:25 ` [Bug tree-optimization/19703] [4.0 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: andrewhutchinson at cox dot net @ 2005-01-30 4:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From andrewhutchinson at cox dot net 2005-01-30 04:58 -------
Subject: Re: Poor optimisation of loop test
I am not sure what makes you think that. Compare with ZERO is
invariabley cheaper than compare with "n".
The former is "free" sign status following any conditioning setting
instruction - like subtract!
Its even the sign bit of the result!
subi r28,10
cpi r28, -10
brpl looptop
subi r28,10
brpl looptop
or did I miss something?
pinskia at gcc dot gnu dot org wrote:
>------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-30 03:17 -------
>Hmm, on most targets it is true that != is the same case as >=.
>
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] [4.0 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
` (2 preceding siblings ...)
2005-01-30 4:58 ` andrewhutchinson at cox dot net
@ 2005-01-30 5:25 ` pinskia at gcc dot gnu dot org
2005-01-30 19:20 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-30 5:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-30 05:25 -------
Confirmed (sorry about that I was thinking of something different at the time).
Here is a better example for normal targets (PPC and x86 too):
extern void foo6(int);
void testloop6 (void)
{
int i;
i = 100;
do {
foo6 ( i);
i-=10;
} while (i != 0);
}
The tree dump for the loop on x86:
<L0>:;
foo6 (i);
D.1592 = (unsigned int) i + 0fffffff6;
i = (int) D.1592;
if (D.1592 != 0) goto <L0>; else goto <L1>;
Note this is not IV-OPTS messing up but DOM changing the if statement.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
GCC target triplet|avr |
Last reconfirmed|0000-00-00 00:00:00 |2005-01-30 05:25:46
date| |
Summary|Poor optimisation of loop |[4.0 Regression] Poor
|test |optimisation of loop test,
| |DOM causing unsigned to int
| |and missing combine compares
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] [4.0 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
` (3 preceding siblings ...)
2005-01-30 5:25 ` [Bug tree-optimization/19703] [4.0 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares pinskia at gcc dot gnu dot org
@ 2005-01-30 19:20 ` pinskia at gcc dot gnu dot org
2005-02-10 23:46 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-30 19:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-30 19:20 -------
Even though DOM is the problem, IV-OPTS can be improved so we don't create the casts in the first
place, patch here to do that: <http://gcc.gnu.org/ml/gcc-patches/2005-01/msg02209.html>.
I will try get a testcase where DOM messes up even without IV-OPTs doing anything.
And here is that testcase, yes it is werid for someone to do this but ...:
extern void foo6(int);
void testloop6 (void)
{
unsigned int D1133;
int i;
i = 100;
do {
foo6 (i);
i = ((unsigned int) i) + 4294967286U;
}while (i != 0);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] [4.0 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
` (4 preceding siblings ...)
2005-01-30 19:20 ` pinskia at gcc dot gnu dot org
@ 2005-02-10 23:46 ` pinskia at gcc dot gnu dot org
2005-04-21 5:05 ` [Bug tree-optimization/19703] [4.0/4.1 " mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-10 23:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-10 21:04 -------
Lowering the priority as IV-OPTs has worked around DOM's problems.
--
What |Removed |Added
----------------------------------------------------------------------------
Priority|P2 |P3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] [4.0/4.1 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
` (5 preceding siblings ...)
2005-02-10 23:46 ` pinskia at gcc dot gnu dot org
@ 2005-04-21 5:05 ` mmitchel at gcc dot gnu dot org
2005-06-26 18:03 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-04-21 5:05 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.0 |4.0.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] [4.0/4.1 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
` (6 preceding siblings ...)
2005-04-21 5:05 ` [Bug tree-optimization/19703] [4.0/4.1 " mmitchel at gcc dot gnu dot org
@ 2005-06-26 18:03 ` pinskia at gcc dot gnu dot org
2005-07-08 1:43 ` mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-26 18:03 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at gcc dot gnu dot org
Last reconfirmed|2005-01-30 05:25:46 |2005-06-26 18:03:23
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] [4.0/4.1 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
` (7 preceding siblings ...)
2005-06-26 18:03 ` pinskia at gcc dot gnu dot org
@ 2005-07-08 1:43 ` mmitchel at gcc dot gnu dot org
2005-08-17 12:43 ` [Bug tree-optimization/19703] [4.0 " pinskia at gcc dot gnu dot org
2005-09-27 16:12 ` mmitchel at gcc dot gnu dot org
10 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-07-08 1:43 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.1 |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] [4.0 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
` (8 preceding siblings ...)
2005-07-08 1:43 ` mmitchel at gcc dot gnu dot org
@ 2005-08-17 12:43 ` pinskia at gcc dot gnu dot org
2005-09-27 16:12 ` mmitchel at gcc dot gnu dot org
10 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-17 12:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-17 12:37 -------
This has been fixed on the mainline now.
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.0.0
Known to work| |3.4.0 4.1.0
Summary|[4.0/4.1 Regression] Poor |[4.0 Regression] Poor
|optimisation of loop test, |optimisation of loop test,
|DOM causing unsigned to int |DOM causing unsigned to int
|and missing combine compares|and missing combine compares
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug tree-optimization/19703] [4.0 Regression] Poor optimisation of loop test, DOM causing unsigned to int and missing combine compares
2005-01-30 2:59 [Bug c/19703] New: Poor optimisation of loop test andrewhutchinson at cox dot net
` (9 preceding siblings ...)
2005-08-17 12:43 ` [Bug tree-optimization/19703] [4.0 " pinskia at gcc dot gnu dot org
@ 2005-09-27 16:12 ` mmitchel at gcc dot gnu dot org
10 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:12 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.2 |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19703
^ permalink raw reply [flat|nested] 13+ messages in thread