public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64
@ 2011-02-23 23:29 sje at cup dot hp.com
2011-03-06 19:07 ` [Bug rtl-optimization/47866] [4.5/4.6 Regression] " ubizjak at gmail dot com
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: sje at cup dot hp.com @ 2011-02-23 23:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
Summary: gcc.dg/torture/vector-2.c fails on IA64
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: sje@cup.hp.com
gcc.dg/torture/vector-2.c is failing on Linux and HP-UX IA64 platforms since
r165240 which is Richard Henderson's fix for PR rtl-opt/33721. This may be a
target specific bug but the change that caused the failure to show up is not
target specific.
gcc.dg/torture/vector-2.c fails at -O2, but passes at -O0 or -O1. With the
latest sources I can use this cutdown test case to see the difference:
#define vector __attribute__((vector_size(16) ))
vector int f0(vector int t, int a)
{
((int*)&t)[0] = a;
return t;
}
vector int f1(vector int t, int a)
{
((int*)&t)[1] = a;
return t;
}
int main(void)
{
vector int a = {0, 0, 0, 0};
vector int a0;
a0 = f0(a, 1);
printf("%d %d %d %d\n", a0[0], a0[1], a0[2], a0[3]);
a0 = f1(a, 1);
printf("%d %d %d %d\n", a0[0], a0[1], a0[2], a0[3]);
return 0;
}
At -O0 or -O1 it prints:
1 0 0 0
0 1 0 0
At -O2 it prints:
1 0 0 0
0 0 0 0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5/4.6 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
@ 2011-03-06 19:07 ` ubizjak at gmail dot com
2011-03-07 10:38 ` rguenth at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2011-03-06 19:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
Uros Bizjak <ubizjak at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.03.06 19:07:33
Target Milestone|--- |4.5.3
Summary|gcc.dg/torture/vector-2.c |[4.5/4.6 Regression]
|fails on IA64 |gcc.dg/torture/vector-2.c
| |fails on IA64
Ever Confirmed|0 |1
--- Comment #1 from Uros Bizjak <ubizjak at gmail dot com> 2011-03-06 19:07:33 UTC ---
Confirmed, a regression due to the failure in the testsuite.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5/4.6 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
2011-03-06 19:07 ` [Bug rtl-optimization/47866] [4.5/4.6 Regression] " ubizjak at gmail dot com
@ 2011-03-07 10:38 ` rguenth at gcc dot gnu.org
2011-03-08 17:05 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-07 10:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Target| |ia64-*-*
Priority|P3 |P2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5/4.6 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
2011-03-06 19:07 ` [Bug rtl-optimization/47866] [4.5/4.6 Regression] " ubizjak at gmail dot com
2011-03-07 10:38 ` rguenth at gcc dot gnu.org
@ 2011-03-08 17:05 ` jakub at gcc dot gnu.org
2011-03-08 17:41 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-08 17:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-08 17:05:07 UTC ---
I think the bug here is during expansion.
We are expanding:
vector(4) int t;
vector(4) int t;
vector(4) int a0;
int D.2001;
int D.2000;
int D.1999;
int D.1998;
<bb 2>:
t = { 0, 0, 0, 0 };
BIT_FIELD_REF <t, 32, 0> = 1;
a0_18 = t;
D.1998_3 = BIT_FIELD_REF <a0_18, 32, 0>;
D.1999_4 = BIT_FIELD_REF <a0_18, 32, 32>;
D.2000_5 = BIT_FIELD_REF <a0_18, 32, 64>;
D.2001_6 = BIT_FIELD_REF <a0_18, 32, 96>;
printf ("%d %d %d %d\n", D.1998_3, D.1999_4, D.2000_5, D.2001_6);
t = { 0, 0, 0, 0 };
BIT_FIELD_REF <t, 32, 32> = 1;
a0_19 = t;
D.1998_8 = BIT_FIELD_REF <a0_19, 32, 0>;
D.1999_9 = BIT_FIELD_REF <a0_19, 32, 32>;
D.2000_10 = BIT_FIELD_REF <a0_19, 32, 64>;
D.2001_11 = BIT_FIELD_REF <a0_19, 32, 96>;
printf ("%d %d %d %d\n", D.1998_8, D.1999_9, D.2000_10, D.2001_11);
All the memory references are MEM_SCALAR_P, except that the stores
BIT_FIELD_REF <t, 32, 0> = 1 and BIT_FIELD_REF <t, 32, 32> = 1 use
MEM_IN_STRUCT_P because store_field decides to override it (set_mem_attributes
doesn't override when it already has one or another one, but store_field does).
This, together with the fact that BIT_FIELD_REF <t, 32, 32> = 1 store
happens to use an address from post_modify and aliasing doesn't figure out it
is sfp based and what is the offset results in
fixed_scalar_and_varying_struct_p
returning true (where fixed scalar is e.g. the BIT_FIELD_REF <a0_19, 64, 0>
or BIT_FIELD_REF <a0_19, 64, 64> access from which BIT_FIELD_REF <a0_19, 32,
XX>
is derived, and "varying" "struct" is the BIT_FIELD_REF <t, 32, 32> = 1 store.
Thus sched1 reorders the reads after the store.
--- expr.c (revision 170779)
+++ expr.c (working copy)
@@ -5924,7 +5924,8 @@ store_field (rtx target, HOST_WIDE_INT b
if (to_rtx == target)
to_rtx = copy_rtx (to_rtx);
- MEM_SET_IN_STRUCT_P (to_rtx, 1);
+ if (!MEM_SCALAR_P (to_rtx))
+ MEM_SET_IN_STRUCT_P (to_rtx, 1);
if (!MEM_KEEP_ALIAS_SET_P (to_rtx) && MEM_ALIAS_SET (to_rtx) != 0)
set_mem_alias_set (to_rtx, alias_set);
fixes this, though the generated code is still very much suboptimal (uses ld8.a
before the store (though, in the same insn group), thus I think it will always
find out that it changed and branch to a slow path doing the load again.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5/4.6 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
` (2 preceding siblings ...)
2011-03-08 17:05 ` jakub at gcc dot gnu.org
@ 2011-03-08 17:41 ` jakub at gcc dot gnu.org
2011-03-08 18:41 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-08 17:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-08 17:40:53 UTC ---
The reason why aliasing believes reg 356 is varying is that sched1 doesn't use
cselib. sched2 should be to figure out. Why it generates ld8.a is unclear to
me, but at least that is not a wrong-code issue.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5/4.6 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
` (3 preceding siblings ...)
2011-03-08 17:41 ` jakub at gcc dot gnu.org
@ 2011-03-08 18:41 ` jakub at gcc dot gnu.org
2011-03-08 23:29 ` mark at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-08 18:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at gcc dot gnu.org,
| |mark at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-08 18:41:04 UTC ---
Seems that MEM_SET_IN_STRUCT_P use in there has been introduced by Mark in
http://gcc.gnu.org/ml/gcc-patches/1999-01/msg00234.html
Any idea why you think it should be unconditional in that case? BIT_FIELD_REF
on a scalar doesn't make it a struct IMHO.
Though, perhaps if (!MEM_SCALAR_P (to_rtx)) MEM_SET_IN_STRUCT_P (to_rtx, 1);
is better written as if (!MEM_SCALAR_P (to_rtx)) MEM_IN_STRUCT_P (to_rtx) = 1;
CCing Mark who wrote that patch and Jeff who reviewed it.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5/4.6 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
` (4 preceding siblings ...)
2011-03-08 18:41 ` jakub at gcc dot gnu.org
@ 2011-03-08 23:29 ` mark at gcc dot gnu.org
2011-03-09 17:27 ` sje at cup dot hp.com
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mark at gcc dot gnu.org @ 2011-03-08 23:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
Mark Wielaard <mark at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|mark at gcc dot gnu.org |mark at codesourcery dot
| |com
--- Comment #5 from Mark Wielaard <mark at gcc dot gnu.org> 2011-03-08 23:29:42 UTC ---
(In reply to comment #4)
> Seems that MEM_SET_IN_STRUCT_P use in there has been introduced by Mark in
> http://gcc.gnu.org/ml/gcc-patches/1999-01/msg00234.html
Different mark. Changed CC.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5/4.6 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
` (5 preceding siblings ...)
2011-03-08 23:29 ` mark at gcc dot gnu.org
@ 2011-03-09 17:27 ` sje at cup dot hp.com
2011-03-09 20:49 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: sje at cup dot hp.com @ 2011-03-09 17:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
--- Comment #6 from Steve Ellcey <sje at cup dot hp.com> 2011-03-09 17:26:44 UTC ---
I tried the patch in comment #2 and verified that it fixes vector-2.c on IA64
HP-UX and Linux and caused no regressions.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5/4.6 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
` (6 preceding siblings ...)
2011-03-09 17:27 ` sje at cup dot hp.com
@ 2011-03-09 20:49 ` jakub at gcc dot gnu.org
2011-03-09 20:52 ` [Bug rtl-optimization/47866] [4.5 " jakub at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-09 20:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-09 20:49:03 UTC ---
Author: jakub
Date: Wed Mar 9 20:49:00 2011
New Revision: 170834
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170834
Log:
PR rtl-optimization/47866
* expr.c (store_field): If MEM_SCALAR_P (target), don't use
MEM_SET_IN_STRUCT_P (to_rtx, 1), just set MEM_IN_STRUCT_P (to_rtx)
if target wasn't scalar.
* function.c (assign_stack_temp_for_type): Assert that neither
MEM_SCALAR_P nor MEM_IN_STRUCT_P is set previously, set either
MEM_IN_STRUCT_P or MEM_SCALAR_P instead of using MEM_SET_IN_STRUCT_P
macro.
* rtl.h (MEM_SET_IN_STRUCT_P): Removed.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/expr.c
trunk/gcc/function.c
trunk/gcc/rtl.h
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
` (7 preceding siblings ...)
2011-03-09 20:49 ` jakub at gcc dot gnu.org
@ 2011-03-09 20:52 ` jakub at gcc dot gnu.org
2011-04-28 15:31 ` rguenth at gcc dot gnu.org
2012-07-02 10:30 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-09 20:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.5/4.6 Regression] |[4.5 Regression]
|gcc.dg/torture/vector-2.c |gcc.dg/torture/vector-2.c
|fails on IA64 |fails on IA64
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-09 20:51:45 UTC ---
Should be fixed on the trunk, ia64-linux bootstrap/regtest just finished.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
` (8 preceding siblings ...)
2011-03-09 20:52 ` [Bug rtl-optimization/47866] [4.5 " jakub at gcc dot gnu.org
@ 2011-04-28 15:31 ` rguenth at gcc dot gnu.org
2012-07-02 10:30 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-28 15:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.5.3 |4.5.4
--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-28 14:51:41 UTC ---
GCC 4.5.3 is being released, adjusting target milestone.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/47866] [4.5 Regression] gcc.dg/torture/vector-2.c fails on IA64
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
` (9 preceding siblings ...)
2011-04-28 15:31 ` rguenth at gcc dot gnu.org
@ 2012-07-02 10:30 ` rguenth at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 10:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47866
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|4.5.4 |4.6.0
--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 10:29:38 UTC ---
Fixed in 4.6.0, the 4.5 branch is being closed.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2012-07-02 10:30 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-23 23:29 [Bug rtl-optimization/47866] New: gcc.dg/torture/vector-2.c fails on IA64 sje at cup dot hp.com
2011-03-06 19:07 ` [Bug rtl-optimization/47866] [4.5/4.6 Regression] " ubizjak at gmail dot com
2011-03-07 10:38 ` rguenth at gcc dot gnu.org
2011-03-08 17:05 ` jakub at gcc dot gnu.org
2011-03-08 17:41 ` jakub at gcc dot gnu.org
2011-03-08 18:41 ` jakub at gcc dot gnu.org
2011-03-08 23:29 ` mark at gcc dot gnu.org
2011-03-09 17:27 ` sje at cup dot hp.com
2011-03-09 20:49 ` jakub at gcc dot gnu.org
2011-03-09 20:52 ` [Bug rtl-optimization/47866] [4.5 " jakub at gcc dot gnu.org
2011-04-28 15:31 ` rguenth at gcc dot gnu.org
2012-07-02 10:30 ` rguenth 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).