public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/44403]  New: vectorization does not maintain 'restrict' qualifier
@ 2010-06-03 15:48 roy dot 1rosen at gmail dot com
  2010-06-03 15:49 ` [Bug tree-optimization/44403] " roy dot 1rosen at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: roy dot 1rosen at gmail dot com @ 2010-06-03 15:48 UTC (permalink / raw)
  To: gcc-bugs

For the following function:

void xxx(short* __restrict__ a, short* __restrict__ b)
{
   int i;
   for (i = 0; i < 8; i++)
   {
       a[i] = b[i];
   }
}

the following is generated in the .optimized file:

xxx (short int * restrict a, short int * restrict b)
{
  vector(2) short int * vect_p.27;
  vector(2) short int vect_var_.26;
  vector(2) short int * vect_p.22;
  int andmask.21;
  int orptrs1.20;
  int addr2int1.19;
  vector(2) short int * vect_p.18;
  int addr2int0.15;
  vector(2) short int * vect_p.14;
  short int D.1998;
  short int * restrict D.1997;
  short int * restrict D.1996;

<bb 2>:
  vect_p.14_18 = (vector(2) short int *) b_9(D);
  addr2int0.15_23 = (int) vect_p.14_18;
  vect_p.18_24 = (vector(2) short int *) a_5(D);
  addr2int1.19_25 = (int) vect_p.18_24;
  orptrs1.20_26 = addr2int0.15_23 | addr2int1.19_25;
  andmask.21_27 = orptrs1.20_26 & 3;
  if (andmask.21_27 == 0)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  vect_var_.26_6 = *vect_p.14_18;
  *vect_p.18_24 = vect_var_.26_6;
  vect_p.22_11 = vect_p.14_18 + 4;
  vect_p.27_12 = vect_p.18_24 + 4;
  vect_var_.26_56 = *vect_p.22_11;
  *vect_p.27_12 = vect_var_.26_56;
  vect_p.22_58 = vect_p.22_11 + 4;
  vect_p.27_59 = vect_p.27_12 + 4;
  vect_var_.26_65 = *vect_p.22_58;
  *vect_p.27_59 = vect_var_.26_65;
  vect_p.22_67 = vect_p.22_58 + 4;
  vect_p.27_68 = vect_p.27_59 + 4;
  vect_var_.26_44 = *vect_p.22_67;
  *vect_p.27_68 = vect_var_.26_44;
  goto <bb 5>;

<bb 4>:
  D.1998_77 = *b_9(D);
  *a_5(D) = D.1998_77;
  D.1996_86 = a_5(D) + 2;
  D.1997_87 = b_9(D) + 2;
  D.1998_88 = *D.1997_87;
  *D.1996_86 = D.1998_88;
  D.1996_97 = a_5(D) + 4;
  D.1997_98 = b_9(D) + 4;
  D.1998_99 = *D.1997_98;
  *D.1996_97 = D.1998_99;
  D.1996_108 = a_5(D) + 6;
  D.1997_109 = b_9(D) + 6;
  D.1998_110 = *D.1997_109;
  *D.1996_108 = D.1998_110;
  D.1996_119 = a_5(D) + 8;
  D.1997_120 = b_9(D) + 8;
  D.1998_121 = *D.1997_120;
  *D.1996_119 = D.1998_121;
  D.1996_130 = a_5(D) + 10;
  D.1997_131 = b_9(D) + 10;
  D.1998_132 = *D.1997_131;
  *D.1996_130 = D.1998_132;
  D.1996_141 = a_5(D) + 12;
  D.1997_142 = b_9(D) + 12;
  D.1998_143 = *D.1997_142;
  *D.1996_141 = D.1998_143;
  D.1996_34 = a_5(D) + 14;
  D.1997_35 = b_9(D) + 14;
  D.1998_36 = *D.1997_35;
  *D.1996_34 = D.1998_36;

<bb 5>:
  return;

} 

You may notice that the vect variables don't have the restrict qualifier.

Using built-in specs.
COLLECT_GCC=./xgcc
Target: i386-elf-linux
Configured with: ../gcc-4.6-20100529/configure --target=i386-elf-linux
--enable-languages=c
Thread model: posix
gcc version 4.6.0 20100529 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-save-temps' '-v' '-O3' '-fno-ivopts' '-mtune=i386'
'-march=i386'
 cc1 -E -quiet -v -iprefix
/home/swproj/sw/users/eyalhar/i386-46/gcc/../lib/gcc/i386-elf-linux/4.6.0/
./a.c -mtune=i386 -march=i386 -fno-ivopts -O3 -fpch-preprocess -o a.i
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/i386-46/gcc/../lib/gcc/i386-elf-linux/4.6.0/include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/i386-46/gcc/../lib/gcc/i386-elf-linux/4.6.0/include-fixed"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/i386-46/gcc/../lib/gcc/i386-elf-linux/4.6.0/../../../../i386-elf-linux/sys-include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/i386-46/gcc/../lib/gcc/i386-elf-linux/4.6.0/../../../../i386-elf-linux/include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/i386-46/gcc/../lib/gcc/../../lib/gcc/i386-elf-linux/4.6.0/include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/i386-46/gcc/../lib/gcc/../../lib/gcc/i386-elf-linux/4.6.0/include-fixed"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/i386-46/gcc/../lib/gcc/../../lib/gcc/i386-elf-linux/4.6.0/../../../../i386-elf-linux/sys-include"
ignoring nonexistent directory
"/home/swproj/sw/users/eyalhar/i386-46/gcc/../lib/gcc/../../lib/gcc/i386-elf-linux/4.6.0/../../../../i386-elf-linux/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
COLLECT_GCC_OPTIONS='-save-temps' '-v' '-O3' '-fno-ivopts' '-mtune=i386'
'-march=i386'
 cc1 -fpreprocessed a.i -quiet -dumpbase a.c -mtune=i386 -march=i386 -auxbase a
-O3 -version -fno-ivopts -o a.s
GNU C (GCC) version 4.6.0 20100529 (experimental) (i386-elf-linux)
        compiled by GNU C version 4.1.2 20080704 (Red Hat 4.1.2-44), GMP
version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C (GCC) version 4.6.0 20100529 (experimental) (i386-elf-linux)
        compiled by GNU C version 4.1.2 20080704 (Red Hat 4.1.2-44), GMP
version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: b29c4bb89017c75caf92d2ab060612f6
COLLECT_GCC_OPTIONS='-save-temps' '-v' '-O3' '-fno-ivopts' '-mtune=i386'
'-march=i386'
 as -V -Qy --32 -o a.o a.s
GNU assembler version 2.17.50.0.6-9.el5 (x86_64-redhat-linux) using BFD version
2.17.50.0.6-9.el5 20061020
COMPILER_PATH=
LIBRARY_PATH=
COLLECT_GCC_OPTIONS='-save-temps' '-v' '-O3' '-fno-ivopts' '-mtune=i386'
'-march=i386'
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 crt1.o crti.o crtbegin.o a.o
-lgcc -lgcc_eh -lc -lgcc -lgcc_eh crtend.o crtn.o
ld: crt1.o: No such file: No such file or directory


-- 
           Summary: vectorization does not maintain 'restrict' qualifier
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: roy dot 1rosen at gmail dot com
 GCC build triplet: elf
  GCC host triplet: linux
GCC target triplet: i386


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


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

* [Bug tree-optimization/44403] vectorization does not maintain 'restrict' qualifier
  2010-06-03 15:48 [Bug tree-optimization/44403] New: vectorization does not maintain 'restrict' qualifier roy dot 1rosen at gmail dot com
@ 2010-06-03 15:49 ` roy dot 1rosen at gmail dot com
  2010-06-03 16:03 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: roy dot 1rosen at gmail dot com @ 2010-06-03 15:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from roy dot 1rosen at gmail dot com  2010-06-03 15:49 -------
Created an attachment (id=20818)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20818&action=view)
preprocessed file


-- 


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


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

* [Bug tree-optimization/44403] vectorization does not maintain 'restrict' qualifier
  2010-06-03 15:48 [Bug tree-optimization/44403] New: vectorization does not maintain 'restrict' qualifier roy dot 1rosen at gmail dot com
  2010-06-03 15:49 ` [Bug tree-optimization/44403] " roy dot 1rosen at gmail dot com
@ 2010-06-03 16:03 ` rguenth at gcc dot gnu dot org
  2010-06-03 19:39 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-06-03 16:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-06-03 16:03 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |missed-optimization
   Last reconfirmed|0000-00-00 00:00:00         |2010-06-03 16:03:01
               date|                            |


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


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

* [Bug tree-optimization/44403] vectorization does not maintain 'restrict' qualifier
  2010-06-03 15:48 [Bug tree-optimization/44403] New: vectorization does not maintain 'restrict' qualifier roy dot 1rosen at gmail dot com
  2010-06-03 15:49 ` [Bug tree-optimization/44403] " roy dot 1rosen at gmail dot com
  2010-06-03 16:03 ` rguenth at gcc dot gnu dot org
@ 2010-06-03 19:39 ` rguenth at gcc dot gnu dot org
  2010-06-03 21:13 ` rguenth at gcc dot gnu dot org
  2010-06-03 21:13 ` rguenth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-06-03 19:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-06-03 19:39 -------
Created an attachment (id=20821)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20821&action=view)
patch

Mine.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug tree-optimization/44403] vectorization does not maintain 'restrict' qualifier
  2010-06-03 15:48 [Bug tree-optimization/44403] New: vectorization does not maintain 'restrict' qualifier roy dot 1rosen at gmail dot com
                   ` (2 preceding siblings ...)
  2010-06-03 19:39 ` rguenth at gcc dot gnu dot org
@ 2010-06-03 21:13 ` rguenth at gcc dot gnu dot org
  2010-06-03 21:13 ` rguenth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-06-03 21:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2010-06-03 21:12 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.6.0


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


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

* [Bug tree-optimization/44403] vectorization does not maintain 'restrict' qualifier
  2010-06-03 15:48 [Bug tree-optimization/44403] New: vectorization does not maintain 'restrict' qualifier roy dot 1rosen at gmail dot com
                   ` (3 preceding siblings ...)
  2010-06-03 21:13 ` rguenth at gcc dot gnu dot org
@ 2010-06-03 21:13 ` rguenth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-06-03 21:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2010-06-03 21:12 -------
Subject: Bug 44403

Author: rguenth
Date: Thu Jun  3 21:12:38 2010
New Revision: 160235

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160235
Log:
2010-06-03  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/44403
        * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref):
        Preserve pointer qualifiers.
        (vect_create_data_ref_ptr): Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-vect-data-refs.c


-- 


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


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

end of thread, other threads:[~2010-06-03 21:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-03 15:48 [Bug tree-optimization/44403] New: vectorization does not maintain 'restrict' qualifier roy dot 1rosen at gmail dot com
2010-06-03 15:49 ` [Bug tree-optimization/44403] " roy dot 1rosen at gmail dot com
2010-06-03 16:03 ` rguenth at gcc dot gnu dot org
2010-06-03 19:39 ` rguenth at gcc dot gnu dot org
2010-06-03 21:13 ` rguenth at gcc dot gnu dot org
2010-06-03 21:13 ` rguenth 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).