* [Bug tree-optimization/59374] [4.8/4.9 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
@ 2013-12-03 9:23 ` rguenth at gcc dot gnu.org
2013-12-03 11:40 ` rguenth at gcc dot gnu.org
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-03 9:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target| |x86_64-*-*
Status|UNCONFIRMED |ASSIGNED
Known to work| |4.7.3
Keywords| |wrong-code
Last reconfirmed| |2013-12-03
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
Ever confirmed|0 |1
Summary|-ftree-slp-vectorize breaks |[4.8/4.9 Regression]
|unique_ptr's move |-ftree-slp-vectorize breaks
|constructor |unique_ptr's move
| |constructor
Target Milestone|--- |4.8.3
Known to fail| |4.8.0, 4.8.2, 4.9.0
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. I will have a look.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.8/4.9 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
2013-12-03 9:23 ` [Bug tree-optimization/59374] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
@ 2013-12-03 11:40 ` rguenth at gcc dot gnu.org
2013-12-03 11:47 ` rguenth at gcc dot gnu.org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-03 11:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
bar = myalloc (); [return slot optimization]
<bb 3>:
_22 = MEM[(struct Bar * const &)&bar + 8];
MEM[(struct Bar * &)&bar + 8] = 0B;
MEM[(struct Foo * &)&foo + 8] = _22;
_23 = MEM[(const struct BarDelete *)&bar].D.39226.alloc_;
MEM[(struct deleter_type *)&foo] = _23;
_7 = std::operator<< <std::char_traits<char> > (&cout, "p ");
is vectorized to
bar = myalloc (); [return slot optimization]
<bb 3>:
_22 = MEM[(struct Bar * const &)&bar + 8];
MEM[(struct Bar * &)&bar + 8] = 0B;
vectp.87_1 = &MEM[(const struct BarDelete *)&bar].D.39226.alloc_;
vect__23.88_36 = MEM[(const struct BarDelete *)vectp.87_1];
_23 = MEM[(const struct BarDelete *)&bar].D.39226.alloc_;
vectp.90_37 = &foo;
MEM[(struct deleter_type *)vectp.90_37] = vect__23.88_36;
_7 = std::operator<< <std::char_traits<char> > (&cout, "p ");
obvious violating a WAR dependency. I'm sure it was me who broke this.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.8/4.9 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
2013-12-03 9:23 ` [Bug tree-optimization/59374] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2013-12-03 11:40 ` rguenth at gcc dot gnu.org
@ 2013-12-03 11:47 ` rguenth at gcc dot gnu.org
2013-12-03 13:02 ` rguenth at gcc dot gnu.org
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-03 11:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Testcase:
extern void abort (void);
static struct X { void *a; void *b; } a, b;
void __attribute__((noinline)) foo (void)
{
void *tem = a.b;
a.b = (void *)0;
b.b = tem;
b.a = a.a;
}
int main()
{
a.b = &a;
foo ();
if (b.b != &a)
abort ();
return 0;
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.8/4.9 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (2 preceding siblings ...)
2013-12-03 11:47 ` rguenth at gcc dot gnu.org
@ 2013-12-03 13:02 ` rguenth at gcc dot gnu.org
2013-12-05 9:12 ` rguenth at gcc dot gnu.org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-03 13:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 31362
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31362&action=edit
patch
Patch I am testing.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.8/4.9 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (3 preceding siblings ...)
2013-12-03 13:02 ` rguenth at gcc dot gnu.org
@ 2013-12-05 9:12 ` rguenth at gcc dot gnu.org
2013-12-05 9:24 ` [Bug tree-optimization/59374] [4.8 " rguenth at gcc dot gnu.org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-05 9:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Thu Dec 5 09:12:29 2013
New Revision: 205694
URL: http://gcc.gnu.org/viewcvs?rev=205694&root=gcc&view=rev
Log:
2013-12-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/59374
* tree-vect-data-refs.c (vect_slp_analyze_data_ref_dependence):
Commonize known and unknown dependence case fixing the allowed
read-write dependence case and dropping code that should not
matter.
* gcc.dg/torture/pr59374-1.c: New testcase.
* gcc.dg/torture/pr59374-2.c: Likewise.
Added:
trunk/gcc/testsuite/gcc.dg/torture/pr59374-1.c
trunk/gcc/testsuite/gcc.dg/torture/pr59374-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vect-data-refs.c
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.8 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (4 preceding siblings ...)
2013-12-05 9:12 ` rguenth at gcc dot gnu.org
@ 2013-12-05 9:24 ` rguenth at gcc dot gnu.org
2014-01-10 9:34 ` [Bug tree-optimization/59374] [4.7/4.8/4.9 " rguenth at gcc dot gnu.org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-05 9:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.9.0
Summary|[4.8/4.9 Regression] |[4.8 Regression]
|-ftree-slp-vectorize breaks |-ftree-slp-vectorize breaks
|unique_ptr's move |unique_ptr's move
|constructor |constructor
Known to fail|4.9.0 |
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.7/4.8/4.9 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (5 preceding siblings ...)
2013-12-05 9:24 ` [Bug tree-optimization/59374] [4.8 " rguenth at gcc dot gnu.org
@ 2014-01-10 9:34 ` rguenth at gcc dot gnu.org
2014-01-10 10:53 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-10 9:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work|4.7.3, 4.9.0 |4.3.6, 4.4.7
Summary|[4.8 Regression] |[4.7/4.8/4.9 Regression]
|-ftree-slp-vectorize breaks |-ftree-slp-vectorize breaks
|unique_ptr's move |unique_ptr's move
|constructor |constructor
Known to fail| |4.6.4, 4.7.3, 4.9.0
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Backporting this fix is hard as it depends on some of the re-org done on trunk,
in particular doing dataref group analysis before dependence analysis, and then
especially marking those stmts as not vectorizable that do not participate in
a group. Also looking closer this isn't fixed on trunk fully either because
if you trick group analysis to succeed but in the end vectorization not
because you let SLP build fail then we still miscompile it:
extern void abort (void);
static struct X { void *a; void *b; } a, b;
void __attribute__((noinline)) foo (void)
{
void *tem = a.b;
a.b = (void *)0;
b.b = tem;
b.a = a.a;
a.a = tem;
}
int main()
{
a.b = &a;
foo ();
if (b.b != &a)
abort ();
return 0;
}
t.c:7:9: note: === vect_analyze_slp ===
t.c:7:9: note: Build SLP for a.a = tem_2;
t.c:7:9: note: Build SLP for a.b = 0B;
t.c:7:9: note: Build SLP failed: different operation in stmt a.b = 0B;
in this case a missed optimization, of course.
Btw, 4.7.3 and 4.6.4 don't work for me for either testcase (they may work
for the original C++ testcase). Wasn't able to check 4.5 right now
(but it has SLP vectorization, too).
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.7/4.8/4.9 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (6 preceding siblings ...)
2014-01-10 9:34 ` [Bug tree-optimization/59374] [4.7/4.8/4.9 " rguenth at gcc dot gnu.org
@ 2014-01-10 10:53 ` rguenth at gcc dot gnu.org
2014-01-10 13:08 ` [Bug tree-optimization/59374] [4.7/4.8 " rguenth at gcc dot gnu.org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-10 10:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.5.4
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Jakub bisected the regression for the testcase in comment #3 to r163757.
Meanwhile verified that 4.5.4 works.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.7/4.8 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (7 preceding siblings ...)
2014-01-10 10:53 ` rguenth at gcc dot gnu.org
@ 2014-01-10 13:08 ` rguenth at gcc dot gnu.org
2014-01-10 13:08 ` [Bug tree-optimization/59374] [4.7/4.8/4.9 " rguenth at gcc dot gnu.org
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-10 13:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.9.0
Summary|[4.7/4.8/4.9 Regression] |[4.7/4.8 Regression]
|-ftree-slp-vectorize breaks |-ftree-slp-vectorize breaks
|unique_ptr's move |unique_ptr's move
|constructor |constructor
Known to fail|4.9.0 |
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Now hopefully really fixed on trunk ;)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.7/4.8/4.9 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (8 preceding siblings ...)
2014-01-10 13:08 ` [Bug tree-optimization/59374] [4.7/4.8 " rguenth at gcc dot gnu.org
@ 2014-01-10 13:08 ` rguenth at gcc dot gnu.org
2014-05-22 9:06 ` [Bug tree-optimization/59374] [4.7/4.8 " rguenth at gcc dot gnu.org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-10 13:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Fri Jan 10 13:07:42 2014
New Revision: 206523
URL: http://gcc.gnu.org/viewcvs?rev=206523&root=gcc&view=rev
Log:
2014-01-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/59374
* tree-vect-slp.c (vect_slp_analyze_bb_1): Move dependence
checking after SLP discovery. Mark stmts not participating
in any SLP instance properly.
* gcc.dg/torture/pr59374-3.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/torture/pr59374-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vect-slp.c
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.7/4.8 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (9 preceding siblings ...)
2014-01-10 13:08 ` [Bug tree-optimization/59374] [4.7/4.8/4.9 " rguenth at gcc dot gnu.org
@ 2014-05-22 9:06 ` rguenth at gcc dot gnu.org
2014-09-17 16:37 ` [Bug tree-optimization/59374] [4.8 " paolo.carlini at oracle dot com
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-05-22 9:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.3 |4.8.4
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 4.8.3 is being released, adjusting target milestone.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.8 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (10 preceding siblings ...)
2014-05-22 9:06 ` [Bug tree-optimization/59374] [4.7/4.8 " rguenth at gcc dot gnu.org
@ 2014-09-17 16:37 ` paolo.carlini at oracle dot com
2014-12-10 12:51 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-09-17 16:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mehta at roguewave dot com
--- Comment #12 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 61863 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.8 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (11 preceding siblings ...)
2014-09-17 16:37 ` [Bug tree-optimization/59374] [4.8 " paolo.carlini at oracle dot com
@ 2014-12-10 12:51 ` rguenth at gcc dot gnu.org
2014-12-19 13:34 ` jakub at gcc dot gnu.org
2015-06-23 8:47 ` rguenth at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-10 12:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.8 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (12 preceding siblings ...)
2014-12-10 12:51 ` rguenth at gcc dot gnu.org
@ 2014-12-19 13:34 ` jakub at gcc dot gnu.org
2015-06-23 8:47 ` rguenth at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.4 |4.8.5
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.4 has been released.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug tree-optimization/59374] [4.8 Regression] -ftree-slp-vectorize breaks unique_ptr's move constructor
2013-12-03 0:02 [Bug tree-optimization/59374] New: -ftree-slp-vectorize breaks unique_ptr's move constructor niteria at gmail dot com
` (13 preceding siblings ...)
2014-12-19 13:34 ` jakub at gcc dot gnu.org
@ 2015-06-23 8:47 ` rguenth at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-23 8:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59374
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Target Milestone|4.8.5 |4.9.0
Known to fail| |4.8.5
--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed for 4.9.0.
^ permalink raw reply [flat|nested] 16+ messages in thread