* [Bug c/29274] 4.1, 4.2 (possibly 4.0?) not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
@ 2006-09-28 16:46 ` eplondke at gmail dot com
2006-09-28 16:46 ` eplondke at gmail dot com
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: eplondke at gmail dot com @ 2006-09-28 16:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from eplondke at gmail dot com 2006-09-28 16:46 -------
Forgot to say: I'm seeing this on an ARM cross-compilation.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c/29274] 4.1, 4.2 (possibly 4.0?) not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
2006-09-28 16:46 ` [Bug c/29274] " eplondke at gmail dot com
@ 2006-09-28 16:46 ` eplondke at gmail dot com
2009-03-27 17:12 ` [Bug target/29274] " ramana at gcc dot gnu dot org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: eplondke at gmail dot com @ 2006-09-28 16:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from eplondke at gmail dot com 2006-09-28 16:45 -------
Created an attachment (id=12351)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12351&action=view)
Test case showing mulsidi problem
Multimedia processing
It's not self-running, but you can see plainly from the assembly output.
If you want a self-running test I can modify it a bit.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/29274] 4.1, 4.2 (possibly 4.0?) not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
2006-09-28 16:46 ` [Bug c/29274] " eplondke at gmail dot com
2006-09-28 16:46 ` eplondke at gmail dot com
@ 2009-03-27 17:12 ` ramana at gcc dot gnu dot org
2009-03-27 17:26 ` [Bug middle-end/29274] [4.2/4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: ramana at gcc dot gnu dot org @ 2009-03-27 17:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from ramana at gcc dot gnu dot org 2009-03-27 17:12 -------
I can see this with trunk as well as 4.3 branch today.
--
ramana at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-03-27 17:12:32
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.2/4.3/4.4 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (2 preceding siblings ...)
2009-03-27 17:12 ` [Bug target/29274] " ramana at gcc dot gnu dot org
@ 2009-03-27 17:26 ` rguenth at gcc dot gnu dot org
2009-03-27 17:27 ` rguenth at gcc dot gnu dot org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-03-27 17:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2009-03-27 17:26 -------
The issue is that TER does not build large trees for the multiplications as
the factors are used multiple times (and come from memory). Thus the expander
does not see the widened multiplication and appearantly combine / lower-subreg
is not able to optimize this.
I think with expand-from-SSA we could enable this optimization during expand.
Simplified testcase:
long long foo (int i, int j)
{
return (long long)i * (long long)j * (long long)i;
}
because we CSE (long long)i we don't optimize this case. Disabling tree-level
CSE re-enables the optimizations: -fno-tree-fre -fno-tree-pre
-fno-tree-dominator-opts
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|target |middle-end
GCC target triplet|arm-unkown-elf |arm-unkown-elf, i?86-*-*
Keywords| |missed-optimization
Summary|4.1, 4.2 (possibly 4.0?) not|[4.2/4.3/4.4 Regression] not
|using mulsidi3 |using mulsidi3
Target Milestone|--- |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.2/4.3/4.4 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (3 preceding siblings ...)
2009-03-27 17:26 ` [Bug middle-end/29274] [4.2/4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
@ 2009-03-27 17:27 ` rguenth at gcc dot gnu dot org
2009-03-30 14:44 ` [Bug middle-end/29274] [4.2/4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-03-27 17:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2009-03-27 17:27 -------
CC'ing micha.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |matz at suse dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.2/4.3/4.4/4.5 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (4 preceding siblings ...)
2009-03-27 17:27 ` rguenth at gcc dot gnu dot org
@ 2009-03-30 14:44 ` rguenth at gcc dot gnu dot org
2009-03-31 19:46 ` [Bug middle-end/29274] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-03-30 14:44 UTC (permalink / raw)
To: gcc-bugs
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.3/4.4/4.5 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (5 preceding siblings ...)
2009-03-30 14:44 ` [Bug middle-end/29274] [4.2/4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
@ 2009-03-31 19:46 ` jsm28 at gcc dot gnu dot org
2009-08-04 12:41 ` rguenth at gcc dot gnu dot org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 19:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jsm28 at gcc dot gnu dot org 2009-03-31 19:46 -------
Closing 4.2 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.2/4.3/4.4/4.5 Regression]|[4.3/4.4/4.5 Regression] not
|not using mulsidi3 |using mulsidi3
Target Milestone|4.2.5 |4.3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.3/4.4/4.5 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (6 preceding siblings ...)
2009-03-31 19:46 ` [Bug middle-end/29274] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
@ 2009-08-04 12:41 ` rguenth at gcc dot gnu dot org
2009-08-26 15:50 ` froydnj at gcc dot gnu dot org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from rguenth at gcc dot gnu dot org 2009-08-04 12:27 -------
GCC 4.3.4 is being released, adjusting target milestone.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.3.4 |4.3.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.3/4.4/4.5 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (7 preceding siblings ...)
2009-08-04 12:41 ` rguenth at gcc dot gnu dot org
@ 2009-08-26 15:50 ` froydnj at gcc dot gnu dot org
2009-08-26 18:35 ` rguenth at gcc dot gnu dot org
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: froydnj at gcc dot gnu dot org @ 2009-08-26 15:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from froydnj at gcc dot gnu dot org 2009-08-26 15:50 -------
Even if the problems in expand are fixed, reassoc is still going to cause
problems with the original testcase. From the dse1 dump:
D.2474_14 = (long long int) vLo_11;
D.2475_15 = (long long int) c1_6;
D.2476_16 = D.2474_14 * D.2475_15;
D.2477_19 = (long long int) c2_8;
D.2478_20 = D.2474_14 * D.2477_19;
>From the reassoc1 dump right after:
D.2474_14 = (long long int) vLo_11;
D.2475_15 = (long long int) c1_6;
D.2477_19 = (long long int) c2_8;
D.2495_16 = D.2477_19 + D.2475_15;
D.2495_20 = D.2495_16 * D.2474_14;
So we've traded a multiplication for an addition, but we've also made it
difficult to see that we could have used mulsidi3.
--
froydnj at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |froydnj at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.3/4.4/4.5 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (8 preceding siblings ...)
2009-08-26 15:50 ` froydnj at gcc dot gnu dot org
@ 2009-08-26 18:35 ` rguenth at gcc dot gnu dot org
2009-12-29 23:21 ` ramana at gcc dot gnu dot org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-26 18:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from rguenth at gcc dot gnu dot org 2009-08-26 18:35 -------
Note that even for
(long long)i * (long long)j * (long long)i
we can only use one mulsidi3, so promoting parts of the multiplications to
additions should be still beneficial.
I suppose we should detect widening multiply on the tree level before
re-association where it is beneficial (if the target doesn't have a native
wide multiplication).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.3/4.4/4.5 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (9 preceding siblings ...)
2009-08-26 18:35 ` rguenth at gcc dot gnu dot org
@ 2009-12-29 23:21 ` ramana at gcc dot gnu dot org
2010-04-22 9:31 ` [Bug middle-end/29274] [4.3/4.4/4.5/4.6 " bernds at gcc dot gnu dot org
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: ramana at gcc dot gnu dot org @ 2009-12-29 23:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from ramana at gcc dot gnu dot org 2009-12-29 23:21 -------
*** Bug 42498 has been marked as a duplicate of this bug. ***
--
ramana at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |carrot at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.3/4.4/4.5/4.6 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (10 preceding siblings ...)
2009-12-29 23:21 ` ramana at gcc dot gnu dot org
@ 2010-04-22 9:31 ` bernds at gcc dot gnu dot org
2010-04-22 10:12 ` [Bug middle-end/29274] [4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: bernds at gcc dot gnu dot org @ 2010-04-22 9:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from bernds at gcc dot gnu dot org 2010-04-22 09:31 -------
Subject: Bug 29274
Author: bernds
Date: Thu Apr 22 09:30:27 2010
New Revision: 158633
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158633
Log:
gcc/
PR middle-end/29274
* optabs.h (expand_widening_mult): Declare.
* tree-pass.h (pass_optimize_widening_mul): Declare.
* tree-ssa-math-opts.c (execute_optimize_widening_mul,
gate_optimize_widening_mul): New static functions.
(pass_optimize_widening_mul): New.
* expr.c (expand_expr_real_2) <case WIDEN_MULT_EXPR>: New
case.
<case MULT_EXPR>: Remove support for widening multiplies.
* tree.def (WIDEN_MULT_EXPR): Tweak comment.
* cfgexpand.c (expand_debug_expr) <case WIDEN_MULT_EXPR>: Use
simplify_gen_unary rather than directly building extensions.
* tree-cfg.c (verify_gimple_assign_binary): Add tests for
WIDEN_MULT_EXPR.
* expmed.c (expand_widening_mult): New function.
* passes.c (init_optimization_passes): Add pass_optimize_widening_mul.
gcc/testsuite/
PR middle-end/29274
* gcc.target/i386/wmul-1.c: New test.
* gcc.target/i386/wmul-2.c: New test.
* gcc.target/bfin/wmul-1.c: New test.
* gcc.target/bfin/wmul-2.c: New test.
Added:
trunk/gcc/testsuite/gcc.target/bfin/wmul-1.c
trunk/gcc/testsuite/gcc.target/bfin/wmul-2.c
trunk/gcc/testsuite/gcc.target/i386/wmul-1.c
trunk/gcc/testsuite/gcc.target/i386/wmul-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgexpand.c
trunk/gcc/expmed.c
trunk/gcc/expr.c
trunk/gcc/passes.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-cfg.c
trunk/gcc/tree-pass.h
trunk/gcc/tree-ssa-math-opts.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.3/4.4/4.5 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (11 preceding siblings ...)
2010-04-22 9:31 ` [Bug middle-end/29274] [4.3/4.4/4.5/4.6 " bernds at gcc dot gnu dot org
@ 2010-04-22 10:12 ` rguenth at gcc dot gnu dot org
2010-04-22 11:26 ` bernds at gcc dot gnu dot org
2010-05-22 18:24 ` rguenth at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-22 10:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from rguenth at gcc dot gnu dot org 2010-04-22 10:11 -------
Fixed for 4.6.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work|3.4.2 |3.4.2 4.6.0
Summary|[4.3/4.4/4.5/4.6 Regression]|[4.3/4.4/4.5 Regression] not
|not using mulsidi3 |using mulsidi3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.3/4.4/4.5 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (12 preceding siblings ...)
2010-04-22 10:12 ` [Bug middle-end/29274] [4.3/4.4/4.5 " rguenth at gcc dot gnu dot org
@ 2010-04-22 11:26 ` bernds at gcc dot gnu dot org
2010-05-22 18:24 ` rguenth at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: bernds at gcc dot gnu dot org @ 2010-04-22 11:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from bernds at gcc dot gnu dot org 2010-04-22 11:26 -------
Subject: Bug 29274
Author: bernds
Date: Thu Apr 22 11:25:44 2010
New Revision: 158642
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158642
Log:
PR middle-end/29274
* gcc.target/arm/wmul-1.c: New test.
* gcc.target/arm/wmul-2.c: New test.
Added:
trunk/gcc/testsuite/gcc.target/arm/wmul-1.c
trunk/gcc/testsuite/gcc.target/arm/wmul-2.c
Modified:
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug middle-end/29274] [4.3/4.4/4.5 Regression] not using mulsidi3
2006-09-28 16:43 [Bug c/29274] New: 4.1, 4.2 (possibly 4.0?) not using mulsidi3 eplondke at gmail dot com
` (13 preceding siblings ...)
2010-04-22 11:26 ` bernds at gcc dot gnu dot org
@ 2010-05-22 18:24 ` rguenth at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from rguenth at gcc dot gnu dot org 2010-05-22 18:11 -------
GCC 4.3.5 is being released, adjusting target milestone.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.3.5 |4.3.6
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29274
^ permalink raw reply [flat|nested] 16+ messages in thread