public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/35371]  New: Missing REG_POINTER attribute causes bad indexed load/store operand ordering
@ 2008-02-25 20:05 bergner at gcc dot gnu dot org
  2008-02-25 20:51 ` [Bug rtl-optimization/35371] " bergner at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: bergner at gcc dot gnu dot org @ 2008-02-25 20:05 UTC (permalink / raw)
  To: gcc-bugs

We fail to correctly order the operands for the indexed store within the loop
below. This seems to be caused by a missing REG_POINTER attribute, so the code
added for PR28690 doesn't have a chance of getting the ordering correct. An
interesting thing is that if we replace the global array with an "extern int
*reg_values;", then we get the ordering correct.

bergner@etna:~/gcc/tests> cat a2-loop.c 
int reg_values[1024];
void
clear_table (unsigned int n)
{
  unsigned int i;
  for (i = 0; i < n; i++)
    reg_values[i] = 0;
}

The "bad" code gen looks like (using -O2 -S):

clear_table:
        cmpwi 0,3,0
        beqlr- 0
        lis 9,reg_values@ha
        slwi 3,3,2
        la 9,reg_values@l(9)
        li 11,0
        li 0,0
        .p2align 4,,15
.L3:
        stwx 0,11,9
        addi 11,11,4
        cmpw 7,11,3
        bne+ 7,.L3
        blr

It's another question on why this isn't using an update form store and branch
on count loop, to halve the size of the loop.  The loop size is particularly
glaring when you use -O2 -funroll-loops, then we get 8 indexed stores (all with
the wrong operand order) and 8 addi's...but I guess that's for another
bugzilla.


-- 
           Summary: Missing REG_POINTER attribute causes bad indexed
                    load/store operand ordering
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: bergner at gcc dot gnu dot org
        ReportedBy: bergner at gcc dot gnu dot org
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/35371] Missing REG_POINTER attribute causes bad indexed load/store operand ordering
  2008-02-25 20:05 [Bug rtl-optimization/35371] New: Missing REG_POINTER attribute causes bad indexed load/store operand ordering bergner at gcc dot gnu dot org
@ 2008-02-25 20:51 ` bergner at gcc dot gnu dot org
  2008-02-26  1:56 ` bergner at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bergner at gcc dot gnu dot org @ 2008-02-25 20:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bergner at gcc dot gnu dot org  2008-02-25 20:50 -------
Created an attachment (id=15231)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15231&action=view)
Patch to GCSE to copy REG_POINTER attribute over to new pseudos.

The culprit here is GCSE. When GCSE creates a pseudo to copy a reaching
expression into, it fails to copy the POINTER attribute over.  I'm testing the
attached patch.


-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/35371] Missing REG_POINTER attribute causes bad indexed load/store operand ordering
  2008-02-25 20:05 [Bug rtl-optimization/35371] New: Missing REG_POINTER attribute causes bad indexed load/store operand ordering bergner at gcc dot gnu dot org
  2008-02-25 20:51 ` [Bug rtl-optimization/35371] " bergner at gcc dot gnu dot org
@ 2008-02-26  1:56 ` bergner at gcc dot gnu dot org
  2008-02-26  1:57 ` bergner at gcc dot gnu dot org
  2008-04-08 15:42 ` bergner at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bergner at gcc dot gnu dot org @ 2008-02-26  1:56 UTC (permalink / raw)
  To: gcc-bugs



-- 

bergner at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-26 01:55:49
               date|                            |


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/35371] Missing REG_POINTER attribute causes bad indexed load/store operand ordering
  2008-02-25 20:05 [Bug rtl-optimization/35371] New: Missing REG_POINTER attribute causes bad indexed load/store operand ordering bergner at gcc dot gnu dot org
  2008-02-25 20:51 ` [Bug rtl-optimization/35371] " bergner at gcc dot gnu dot org
  2008-02-26  1:56 ` bergner at gcc dot gnu dot org
@ 2008-02-26  1:57 ` bergner at gcc dot gnu dot org
  2008-04-08 15:42 ` bergner at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bergner at gcc dot gnu dot org @ 2008-02-26  1:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

bergner at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.3.0 4.4.0
           Priority|P3                          |P2


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/35371] Missing REG_POINTER attribute causes bad indexed load/store operand ordering
  2008-02-25 20:05 [Bug rtl-optimization/35371] New: Missing REG_POINTER attribute causes bad indexed load/store operand ordering bergner at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-02-26  1:57 ` bergner at gcc dot gnu dot org
@ 2008-04-08 15:42 ` bergner at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bergner at gcc dot gnu dot org @ 2008-04-08 15:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bergner at gcc dot gnu dot org  2008-04-08 15:41 -------
An updated patch (minus the rtlanal.c which has since been reverted) has fixed
this problem.

http://gcc.gnu.org/ml/gcc-patches/2008-03/msg02044.html


-- 

bergner at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-04-08 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-25 20:05 [Bug rtl-optimization/35371] New: Missing REG_POINTER attribute causes bad indexed load/store operand ordering bergner at gcc dot gnu dot org
2008-02-25 20:51 ` [Bug rtl-optimization/35371] " bergner at gcc dot gnu dot org
2008-02-26  1:56 ` bergner at gcc dot gnu dot org
2008-02-26  1:57 ` bergner at gcc dot gnu dot org
2008-04-08 15:42 ` bergner 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).