public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/52584] New: Fails to constant fold vector upper/lower half BIT_FIELD_REFs
@ 2012-03-14 13:01 rguenth at gcc dot gnu.org
2012-03-14 15:35 ` [Bug middle-end/52584] " rguenth at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-14 13:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52584
Bug #: 52584
Summary: Fails to constant fold vector upper/lower half
BIT_FIELD_REFs
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: rguenth@gcc.gnu.org
ReportedBy: rguenth@gcc.gnu.org
Target: x86_64-*-*
int main()
{
int a = 1;
typedef int v4si __attribute__ ((vector_size (8 * sizeof(int))));
v4si x;
v4si y;
y = x + a;
foo(y);
return 0;
}
shows a missed optimization in how we fold BIT_FIELD_REFs that select
the upper/lower part of a vector:
<bb 2>:
D.1719_9 = BIT_FIELD_REF <x_4(D), 128, 0>;
D.1721_10 = BIT_FIELD_REF <{ 1, 1, 1, 1, 1, 1, 1, 1 }, 128, 0>;
D.1722_11 = D.1719_9 + D.1721_10;
D.1723_12 = BIT_FIELD_REF <x_4(D), 128, 128>;
D.1725_13 = BIT_FIELD_REF <{ 1, 1, 1, 1, 1, 1, 1, 1 }, 128, 128>;
D.1726_14 = D.1723_12 + D.1725_13;
y_5 = {D.1722_11, D.1726_14};
foo (y_5);
return 0;
we should have constant-folded D.1721_10 and D.1725_13.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/52584] Fails to constant fold vector upper/lower half BIT_FIELD_REFs
2012-03-14 13:01 [Bug middle-end/52584] New: Fails to constant fold vector upper/lower half BIT_FIELD_REFs rguenth at gcc dot gnu.org
@ 2012-03-14 15:35 ` rguenth at gcc dot gnu.org
2012-03-16 13:33 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-14 15:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52584
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-14 14:55:16 UTC ---
Author: rguenth
Date: Wed Mar 14 14:55:11 2012
New Revision: 185385
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185385
Log:
2012-03-14 Richard Guenther <rguenther@suse.de>
PR middle-end/52584
* tree-vect-generic.c (type_for_widest_vector_mode): Take
element type instead of mode, use build_vector_type_for_mode
instead of the langhook, build a vector of proper signedness.
(expand_vector_operations_1): Adjust.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-vect-generic.c
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/52584] Fails to constant fold vector upper/lower half BIT_FIELD_REFs
2012-03-14 13:01 [Bug middle-end/52584] New: Fails to constant fold vector upper/lower half BIT_FIELD_REFs rguenth at gcc dot gnu.org
2012-03-14 15:35 ` [Bug middle-end/52584] " rguenth at gcc dot gnu.org
@ 2012-03-16 13:33 ` rguenth at gcc dot gnu.org
2012-03-16 14:54 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-16 13:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52584
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2012-03-16
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/52584] Fails to constant fold vector upper/lower half BIT_FIELD_REFs
2012-03-14 13:01 [Bug middle-end/52584] New: Fails to constant fold vector upper/lower half BIT_FIELD_REFs rguenth at gcc dot gnu.org
2012-03-14 15:35 ` [Bug middle-end/52584] " rguenth at gcc dot gnu.org
2012-03-16 13:33 ` rguenth at gcc dot gnu.org
@ 2012-03-16 14:54 ` rguenth at gcc dot gnu.org
2012-03-16 18:46 ` rguenth at gcc dot gnu.org
2012-05-19 7:59 ` davem at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-16 14:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52584
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-16 14:49:11 UTC ---
Author: rguenth
Date: Fri Mar 16 14:49:05 2012
New Revision: 185468
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185468
Log:
2012-03-16 Richard Guenther <rguenther@suse.de>
PR middle-end/52584
* fold-const.c (fold_ternary_loc): Fold vector typed BIT_FIELD_REFs
of vector constants and constructors.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/52584] Fails to constant fold vector upper/lower half BIT_FIELD_REFs
2012-03-14 13:01 [Bug middle-end/52584] New: Fails to constant fold vector upper/lower half BIT_FIELD_REFs rguenth at gcc dot gnu.org
` (2 preceding siblings ...)
2012-03-16 14:54 ` rguenth at gcc dot gnu.org
@ 2012-03-16 18:46 ` rguenth at gcc dot gnu.org
2012-05-19 7:59 ` davem at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-16 18:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52584
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-16 16:54:43 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/52584] Fails to constant fold vector upper/lower half BIT_FIELD_REFs
2012-03-14 13:01 [Bug middle-end/52584] New: Fails to constant fold vector upper/lower half BIT_FIELD_REFs rguenth at gcc dot gnu.org
` (3 preceding siblings ...)
2012-03-16 18:46 ` rguenth at gcc dot gnu.org
@ 2012-05-19 7:59 ` davem at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: davem at gcc dot gnu.org @ 2012-05-19 7:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52584
--- Comment #4 from davem at gcc dot gnu.org 2012-05-19 06:19:16 UTC ---
Author: davem
Date: Sat May 19 06:19:10 2012
New Revision: 187675
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187675
Log:
Fix VIS3 vector shift wrong code generation on sparc.
Backport r185385 from mainline.
2012-03-14 Richard Guenther <rguenther@suse.de>
PR middle-end/52584
* tree-vect-generic.c (type_for_widest_vector_mode): Take
element type instead of mode, use build_vector_type_for_mode
instead of the langhook, build a vector of proper signedness.
(expand_vector_operations_1): Adjust.
Modified:
branches/gcc-4_7-branch/gcc/ChangeLog
branches/gcc-4_7-branch/gcc/tree-vect-generic.c
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-05-19 6:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-14 13:01 [Bug middle-end/52584] New: Fails to constant fold vector upper/lower half BIT_FIELD_REFs rguenth at gcc dot gnu.org
2012-03-14 15:35 ` [Bug middle-end/52584] " rguenth at gcc dot gnu.org
2012-03-16 13:33 ` rguenth at gcc dot gnu.org
2012-03-16 14:54 ` rguenth at gcc dot gnu.org
2012-03-16 18:46 ` rguenth at gcc dot gnu.org
2012-05-19 7:59 ` davem at gcc dot gnu.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).