public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/26359]  New: Over optimization of loop when using -ftree-vectorize
@ 2006-02-19  2:24 anton at samba dot org
  2006-02-19  2:26 ` [Bug tree-optimization/26359] [4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: anton at samba dot org @ 2006-02-19  2:24 UTC (permalink / raw)
  To: gcc-bugs

Using a gcc build from today I tried one of the autovectorization test cases
and found it over optimized:

$ ~/toolchain/install/bin/gcc  -v
Using built-in specs.
Target: powerpc-linux
Configured with: /home/anton/toolchain/gcc/gcc/configure --build=powerpc-linux
--host=powerpc-linux --target=powerpc-linux --enable-targets=powerpc64-linux
--enable-languages=c,c++,fortran --prefix=/home/anton/toolchain/install
Thread model: posix
gcc version 4.2.0 20060215 (experimental)

$ cat example1.c
int a[256], b[256], c[256];
foo () {
  int i;

  for (i=0; i<256; i++){
    a[i] = b[i] + c[i];
  }
}

$ ~/toolchain/install/bin/gcc -c -O1 -ftree-vectorize
-ftree-vectorizer-verbose=5 -maltivec -o example1_vect.o example1.c

example1.c:5: note: LOOP VECTORIZED.
example1.c:5: note: vectorized 1 loops in function.

$ objdump -d example1_vect.o

example1_vect.o:     file format elf32-powerpc

Disassembly of section .text:

00000000 <foo>:
   0:   94 21 ff f0     stwu    r1,-16(r1)
   4:   38 00 00 40     li      r0,64
   8:   7c 09 03 a6     mtctr   r0
   c:   42 00 00 00     bdnz-   c <foo+0xc>
  10:   38 21 00 10     addi    r1,r1,16
  14:   4e 80 00 20     blr


-- 
           Summary: Over optimization of loop when using -ftree-vectorize
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anton at samba dot org
GCC target triplet: powerpc64-linux


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


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

* [Bug tree-optimization/26359] [4.2 Regression] Over optimization of loop when using -ftree-vectorize
  2006-02-19  2:24 [Bug tree-optimization/26359] New: Over optimization of loop when using -ftree-vectorize anton at samba dot org
@ 2006-02-19  2:26 ` pinskia at gcc dot gnu dot org
  2006-02-19 15:34 ` dorit at il dot ibm dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-19  2:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-19 02:26 -------
Confirmed, also fails on x86_64.

This is a regression from 4.1.0.  It also looks like an aliasing issue too as
DCE is removing the statements.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
 GCC target triplet|powerpc64-linux             |
           Keywords|                            |alias, wrong-code
      Known to fail|                            |4.2.0 4.1.0
      Known to work|                            |4.1.0
   Last reconfirmed|0000-00-00 00:00:00         |2006-02-19 02:26:33
               date|                            |
            Summary|Over optimization of loop   |[4.2 Regression] Over
                   |when using -ftree-vectorize |optimization of loop when
                   |                            |using -ftree-vectorize
   Target Milestone|---                         |4.2.0


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


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

* [Bug tree-optimization/26359] [4.2 Regression] Over optimization of loop when using -ftree-vectorize
  2006-02-19  2:24 [Bug tree-optimization/26359] New: Over optimization of loop when using -ftree-vectorize anton at samba dot org
  2006-02-19  2:26 ` [Bug tree-optimization/26359] [4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-02-19 15:34 ` dorit at il dot ibm dot com
  2006-02-21 22:02 ` dorit at il dot ibm dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dorit at il dot ibm dot com @ 2006-02-19 15:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dorit at il dot ibm dot com  2006-02-19 15:34 -------
The problem is that during dce the call to is_hidden_global_store returns false
cause the tag is not marked as global/static.

This seems to fix it:

Index: tree-ssa-alias.c
===================================================================
*** tree-ssa-alias.c    (revision 110911)
--- tree-ssa-alias.c    (working copy)
*************** new_type_alias (tree ptr, tree var)
*** 2638,2643 ****
--- 2638,2651 ----
            add_may_alias (tag, al);
        }
      }
+ 
+   /* CHECKME:
+   DECL_CONTEXT (tag) = DECL_CONTEXT (var);
+   TREE_PUBLIC  (tag) = TREE_PUBLIC (var);
+   TREE_READONLY (tag) = TREE_READONLY (var);
+   */
+   MTAG_GLOBAL (tag) = DECL_EXTERNAL (var);
+   TREE_STATIC (tag) = TREE_STATIC (var);
  }

but I don't know if it's the right thing to do in the general case.


-- 

dorit at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dorit at il dot ibm dot com,
                   |                            |victork at il dot ibm dot
                   |                            |com


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


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

* [Bug tree-optimization/26359] [4.2 Regression] Over optimization of loop when using -ftree-vectorize
  2006-02-19  2:24 [Bug tree-optimization/26359] New: Over optimization of loop when using -ftree-vectorize anton at samba dot org
  2006-02-19  2:26 ` [Bug tree-optimization/26359] [4.2 Regression] " pinskia at gcc dot gnu dot org
  2006-02-19 15:34 ` dorit at il dot ibm dot com
@ 2006-02-21 22:02 ` dorit at il dot ibm dot com
  2006-02-22  1:35 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dorit at il dot ibm dot com @ 2006-02-21 22:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dorit at il dot ibm dot com  2006-02-21 22:01 -------
patch:
http://gcc.gnu.org/ml/gcc-patches/2006-02/msg01710.html


-- 


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


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

* [Bug tree-optimization/26359] [4.2 Regression] Over optimization of loop when using -ftree-vectorize
  2006-02-19  2:24 [Bug tree-optimization/26359] New: Over optimization of loop when using -ftree-vectorize anton at samba dot org
                   ` (2 preceding siblings ...)
  2006-02-21 22:02 ` dorit at il dot ibm dot com
@ 2006-02-22  1:35 ` patchapp at dberlin dot org
  2006-02-26 10:09 ` dorit at gcc dot gnu dot org
  2006-02-26 14:47 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2006-02-22  1:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from patchapp at dberlin dot org  2006-02-22 01:35 -------
Subject: Bug number PR tree-optimization/26359

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-02/msg01710.html


-- 


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


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

* [Bug tree-optimization/26359] [4.2 Regression] Over optimization of loop when using -ftree-vectorize
  2006-02-19  2:24 [Bug tree-optimization/26359] New: Over optimization of loop when using -ftree-vectorize anton at samba dot org
                   ` (3 preceding siblings ...)
  2006-02-22  1:35 ` patchapp at dberlin dot org
@ 2006-02-26 10:09 ` dorit at gcc dot gnu dot org
  2006-02-26 14:47 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: dorit at gcc dot gnu dot org @ 2006-02-26 10:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dorit at gcc dot gnu dot org  2006-02-26 09:27 -------
Subject: Bug 26359

Author: dorit
Date: Sun Feb 26 09:27:35 2006
New Revision: 111451

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111451
Log:
        PR tree-optimization/26359
        * tree-ssa-alias.c (new_type_alias): Set fields for new tag.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/dump-tree-dceloop-pr26359.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/vect/vect.exp
    trunk/gcc/tree-ssa-alias.c


-- 


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


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

* [Bug tree-optimization/26359] [4.2 Regression] Over optimization of loop when using -ftree-vectorize
  2006-02-19  2:24 [Bug tree-optimization/26359] New: Over optimization of loop when using -ftree-vectorize anton at samba dot org
                   ` (4 preceding siblings ...)
  2006-02-26 10:09 ` dorit at gcc dot gnu dot org
@ 2006-02-26 14:47 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-26 14:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-02-26 14:44 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2006-02-26 14:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-19  2:24 [Bug tree-optimization/26359] New: Over optimization of loop when using -ftree-vectorize anton at samba dot org
2006-02-19  2:26 ` [Bug tree-optimization/26359] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-02-19 15:34 ` dorit at il dot ibm dot com
2006-02-21 22:02 ` dorit at il dot ibm dot com
2006-02-22  1:35 ` patchapp at dberlin dot org
2006-02-26 10:09 ` dorit at gcc dot gnu dot org
2006-02-26 14:47 ` pinskia 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).