[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-07-22 Thread bernds at gcc dot gnu dot org


--- Comment #10 from bernds at gcc dot gnu dot org  2010-07-22 20:02 ---
Huh, I thought I'd replied to this weeks ago - probably wasn't logged in.

Reload can't determine the required structure of a memory address from a
predicate name, so it ignores predicates and only looks at constraints.

One way of fixing this might be to make the mem explicit in the pattern, and
require a register_operand as its address.  It might also work to keep the
memory_operand but add a constraint that only allows single-reg addresses; if
that fails as you say maybe you need to define secondary reloads for it?  Can't
tell for sure without seeing the code and the failure.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-24 Thread ebotcazou at gcc dot gnu dot org


--- Comment #9 from ebotcazou at gcc dot gnu dot org  2010-06-24 11:06 
---
> The memory_reg_operand predicate checks this and fails if it is not a memory
> with a single reg, but apparently there is no constraint letter that would
> require the same.  So, either we need to add a new constraint letter for 
> memory
> that satisfies memory_reg_operand, or find out why predicate hasn't been
> consulted.

Adding a new constraint letter yields reload failures, presumably because
reload doesn't know how to go from MEM[reg+offset] to MEM[reg] on its own.

Bernd, are you really sure the predicate can be bypassed like that?


-- 

ebotcazou at gcc dot gnu dot org changed:

   What|Removed |Added

 CC|ebotcazou at gcc dot gnu dot|
   |org |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-24 Thread jakub at gcc dot gnu dot org


--- Comment #8 from jakub at gcc dot gnu dot org  2010-06-24 10:57 ---
The cas/casx insns only allow (mem (reg)) addressing:
(match_operand:I48MODE 1 "memory_reg_operand" "+m")
(match_operand:DI 1 "memory_reg_operand" "+m")

The memory_reg_operand predicate checks this and fails if it is not a memory
with a single reg, but apparently there is no constraint letter that would
require the same.  So, either we need to add a new constraint letter for memory
that satisfies memory_reg_operand, or find out why predicate hasn't been
consulted.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-11 Thread bernds at gcc dot gnu dot org


--- Comment #7 from bernds at gcc dot gnu dot org  2010-06-11 21:32 ---
This would appear to be a bug in the sparc backend then; my patch is only
exposing it.  I'll not investigate further and leave this for a Sparc
maintainer since I have no clue about the machine.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-11 Thread ebotcazou at gcc dot gnu dot org


--- Comment #6 from ebotcazou at gcc dot gnu dot org  2010-06-11 21:30 
---
Investigating.


-- 

ebotcazou at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |ebotcazou at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2010-06-11 21:30:34
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-11 Thread ebotcazou at gcc dot gnu dot org


--- Comment #5 from ebotcazou at gcc dot gnu dot org  2010-06-11 21:29 
---
*** Bug 44494 has been marked as a duplicate of this bug. ***


-- 

ebotcazou at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||ro at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-11 Thread mikpe at it dot uu dot se


--- Comment #4 from mikpe at it dot uu dot se  2010-06-11 21:27 ---
The bug is easily observed with a cross to sparc64-linux, using e.g. the
task-2.c test case in libgomp's libgomp.c test suite.

Diffing the -S output of 4.6-20100605 vanilla (bad) with the same where r160260
has been reverted (ok), we see:

--- task-2.s-bad2010-06-11 22:45:02.0 +0200
+++ task-2.s-ok 2010-06-11 22:51:56.0 +0200
@@ -5,20 +5,21 @@
.proc   020
 f2._omp_fn.1:
.register   %g2, #scratch
+   .register   %g3, #scratch
add %sp, -192, %sp
lduw[%o0+12], %g1
st  %g1, [%sp+2235]
lduw[%o0+8], %g2
cmp %g2, 10
bne,pt  %icc, .LL7
-nop
+add%sp, 2235, %g3
ba,pt   %xcc, .LL9
 sub%sp, -192, %sp
 .LL5:
 .LL7:
membar  15
add %g1, 1, %g2
-   cas [%sp+2235], %g1, %g2
+   cas [%g3], %g1, %g2
cmp %g1, %g2
bne,pt  %icc, .LL5
 mov%g2, %g1

So what r160260 did was to replace [%g3] in the cas instruction with
[%sp+2235], which doesn't work because cas cannot use [reg+offset] addressing
modes, it only accepts [reg] addressing modes.

Attempting to assemble these files confirms:
> sparc64-unknown-linux-as task-2.s-ok
> sparc64-unknown-linux-as task-2.s-bad 
task-2.s-bad: Assembler messages:
task-2.s-bad:21: Error: Illegal operands
task-2.s-bad:48: Error: Illegal operands

To compile task-2.c I used sparc64-unknown-linux-gcc -mcpu=v9
-fmessage-length=0 -fopenmp -O2 -S task-2.c (the -mcpu=v9 may be redundant, but
that's what the libgomp test suite did on the actual sparc64 box).

My sparc64 cross is configured simply with --target=sparc64-unknown-linux
--enable-languages=c.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-11 Thread mikpe at it dot uu dot se


--- Comment #3 from mikpe at it dot uu dot se  2010-06-11 21:10 ---
Created an attachment (id=20898)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20898&action=view)
working -S output from gcc-4.6-20100605 with r160260 reverted


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-11 Thread mikpe at it dot uu dot se


--- Comment #2 from mikpe at it dot uu dot se  2010-06-11 21:09 ---
Created an attachment (id=20897)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20897&action=view)
broken -S output from gcc-4.6-20100605


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-11 Thread mikpe at it dot uu dot se


--- Comment #1 from mikpe at it dot uu dot se  2010-06-11 21:07 ---
Created an attachment (id=20896)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20896&action=view)
task-2.c test case from libgomp's test suite


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484



[Bug rtl-optimization/44484] [4.6 regression] revision 160260 caused sparc64 testsuite failures

2010-06-10 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44484