public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/32810] New: Not folding of const element for goto
@ 2007-07-18 15:40 pinskia at gcc dot gnu dot org
2007-07-19 18:08 ` [Bug tree-optimization/32810] " rguenth at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-18 15:40 UTC (permalink / raw)
To: gcc-bugs
Testcase:
void a(int*); void b(int*); void c(int*); void d(int*);
void func2(int* val) {
const void *const labels[] = { &&a, &&b, &&c, &&d };
goto *labels[2];
a: a(val);
b: b(val);
c: c(val);
d: d(val);
}
Right now we get (for PPC-darwin):
;; goto labels[2]
(insn 6 5 7 t5.c:10 (set (reg:SI 121)
(high:SI (label_ref:SI 0))) -1 (nil))
(insn 7 6 8 t5.c:10 (set (reg:SI 120)
(lo_sum:SI (reg:SI 121)
(label_ref:SI 0))) -1 (expr_list:REG_EQUAL (label_ref:SI 0)
(nil)))
(jump_insn 8 7 9 t5.c:10 (set (pc)
(reg:SI 120)) -1 (nil))
See how we get the "correct" proping of array element.
--
Summary: Not folding of const element for goto
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization, TREE
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32810
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/32810] Not folding of const element for goto
2007-07-18 15:40 [Bug tree-optimization/32810] New: Not folding of const element for goto pinskia at gcc dot gnu dot org
@ 2007-07-19 18:08 ` rguenth at gcc dot gnu dot org
2008-03-26 23:38 ` rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-07-19 18:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2007-07-19 18:08 -------
Confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-07-19 18:08:04
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32810
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/32810] Not folding of const element for goto
2007-07-18 15:40 [Bug tree-optimization/32810] New: Not folding of const element for goto pinskia at gcc dot gnu dot org
2007-07-19 18:08 ` [Bug tree-optimization/32810] " rguenth at gcc dot gnu dot org
@ 2008-03-26 23:38 ` rguenth at gcc dot gnu dot org
2008-03-27 16:33 ` rguenth at gcc dot gnu dot org
2008-03-27 16:33 ` rguenth at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-26 23:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-03-26 23:37 -------
Useless conversions get in the way here. I have a patch.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2007-07-19 18:08:04 |2008-03-26 23:37:19
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32810
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/32810] Not folding of const element for goto
2007-07-18 15:40 [Bug tree-optimization/32810] New: Not folding of const element for goto pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-03-27 16:33 ` rguenth at gcc dot gnu dot org
@ 2008-03-27 16:33 ` rguenth at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-27 16:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2008-03-27 16:33 -------
Subject: Bug 32810
Author: rguenth
Date: Thu Mar 27 16:32:28 2008
New Revision: 133645
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133645
Log:
2008-03-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32810
* tree-ssa-ccp.c (get_symbol_constant_value): Strip useless
conversions from DECL_INITIAL.
(fold_const_aggregate_ref): Likewise from constructor elements.
* gcc.dg/tree-ssa/ssa-ccp-18.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-18.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-ccp.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32810
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/32810] Not folding of const element for goto
2007-07-18 15:40 [Bug tree-optimization/32810] New: Not folding of const element for goto pinskia at gcc dot gnu dot org
2007-07-19 18:08 ` [Bug tree-optimization/32810] " rguenth at gcc dot gnu dot org
2008-03-26 23:38 ` rguenth at gcc dot gnu dot org
@ 2008-03-27 16:33 ` rguenth at gcc dot gnu dot org
2008-03-27 16:33 ` rguenth at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-27 16:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2008-03-27 16:32 -------
Fixed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32810
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-03-27 16:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18 15:40 [Bug tree-optimization/32810] New: Not folding of const element for goto pinskia at gcc dot gnu dot org
2007-07-19 18:08 ` [Bug tree-optimization/32810] " rguenth at gcc dot gnu dot org
2008-03-26 23:38 ` rguenth at gcc dot gnu dot org
2008-03-27 16:33 ` rguenth at gcc dot gnu dot org
2008-03-27 16:33 ` rguenth 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).