public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/37742]  New: ICE when compile mpich2-1.1.0a1
@ 2008-10-06  5:18 linuxl4 at sohu dot com
  2008-10-06 15:56 ` [Bug middle-end/37742] " rguenth at gcc dot gnu dot org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: linuxl4 at sohu dot com @ 2008-10-06  5:18 UTC (permalink / raw)
  To: gcc-bugs

I don't know how to make a preprocessed source,sorry!

$gcc --version
gcc (GCC) 4.4.0 20081005 (experimental)

$cd mpich2-1.1.0a1; mkdir build; cd build
$../configure --prefix=/usr/local/mpich2; make

  CC              ../../../../src/mpi/coll/opsum.c
../../../../src/mpi/coll/opsum.c: In function 'MPIR_SUM':
../../../../src/mpi/coll/opsum.c:21: internal compiler error: in
vectorizable_load, at tree-vect-transform.c:6675
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [opsum.o] Error 1
make[3]: Leaving directory
`/mnt/usr/fortran/packages/mpich2-1.1.0a1/build/src/mpi/coll'
make[2]: *** [all-redirect] Error 2
make[2]: Leaving directory
`/mnt/usr/fortran/packages/mpich2-1.1.0a1/build/src/mpi'
make[1]: *** [all-redirect] Error 2
make[1]: Leaving directory `/mnt/usr/fortran/packages/mpich2-1.1.0a1/build/src'


-- 
           Summary: ICE when compile mpich2-1.1.0a1
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: linuxl4 at sohu dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug middle-end/37742] ICE when compile mpich2-1.1.0a1
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
@ 2008-10-06 15:56 ` rguenth at gcc dot gnu dot org
  2008-10-06 16:22 ` linuxl4 at sohu dot com
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-10-06 15:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-10-06 15:55 -------
We need a testcase for this (preprocessed source of opsum.c).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug middle-end/37742] ICE when compile mpich2-1.1.0a1
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
  2008-10-06 15:56 ` [Bug middle-end/37742] " rguenth at gcc dot gnu dot org
@ 2008-10-06 16:22 ` linuxl4 at sohu dot com
  2008-10-06 16:33 ` jakub at gcc dot gnu dot org
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: linuxl4 at sohu dot com @ 2008-10-06 16:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from linuxl4 at sohu dot com  2008-10-06 16:21 -------
I really don't know how to make the preprocessed source ,since no include path
is given. the Makefile only give the message such as: 
  CC              ../../../../src/mpi/coll/opsum.c

I will study it.someone maybe can help me do this.

mpich2-1.1.0a1.tar.gz can be download from 
http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads




-- 


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


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

* [Bug middle-end/37742] ICE when compile mpich2-1.1.0a1
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
  2008-10-06 15:56 ` [Bug middle-end/37742] " rguenth at gcc dot gnu dot org
  2008-10-06 16:22 ` linuxl4 at sohu dot com
@ 2008-10-06 16:33 ` jakub at gcc dot gnu dot org
  2008-10-07  5:03 ` linuxl4 at sohu dot com
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-10-06 16:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2008-10-06 16:31 -------
If you read the URL gcc printed ( http://gcc.gnu.org/bugs.html ), you'll know
how to produce it.


-- 


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


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

* [Bug middle-end/37742] ICE when compile mpich2-1.1.0a1
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (2 preceding siblings ...)
  2008-10-06 16:33 ` jakub at gcc dot gnu dot org
@ 2008-10-07  5:03 ` linuxl4 at sohu dot com
  2008-10-07  5:08 ` linuxl4 at sohu dot com
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: linuxl4 at sohu dot com @ 2008-10-07  5:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from linuxl4 at sohu dot com  2008-10-07 05:02 -------
Created an attachment (id=16471)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16471&action=view)
the preprocessed source


-- 


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


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

* [Bug middle-end/37742] ICE when compile mpich2-1.1.0a1
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (3 preceding siblings ...)
  2008-10-07  5:03 ` linuxl4 at sohu dot com
@ 2008-10-07  5:08 ` linuxl4 at sohu dot com
  2008-10-07 20:47 ` pinskia at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: linuxl4 at sohu dot com @ 2008-10-07  5:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from linuxl4 at sohu dot com  2008-10-07 05:07 -------
gcc -O3 -march=pentium4 -c opsum.c  fails.

instead,
gcc -O2 -march=pentium4 -c opsum.c  
or
gcc -O3 -march=i686 -c opsum.c
pass.


-- 

linuxl4 at sohu dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |UNCONFIRMED


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


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

* [Bug middle-end/37742] ICE when compile mpich2-1.1.0a1
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (4 preceding siblings ...)
  2008-10-07  5:08 ` linuxl4 at sohu dot com
@ 2008-10-07 20:47 ` pinskia at gcc dot gnu dot org
  2008-10-07 21:05 ` [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer to struct pinskia at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-10-07 20:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2008-10-07 20:45 -------
Reducing ...


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer to struct
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (5 preceding siblings ...)
  2008-10-07 20:47 ` pinskia at gcc dot gnu dot org
@ 2008-10-07 21:05 ` pinskia at gcc dot gnu dot org
  2008-10-07 21:06 ` pinskia at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-10-07 21:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2008-10-07 21:04 -------
Reduced testcase:
typedef struct {
  float re;
  float im;
} d_complex;

void MPIR_SUM ( d_complex * __restrict a, d_complex * __restrict b, int len)
{
  int i;
  for ( i=0; i<len; i++ )
  {
    a[i].re = ((a[i].re)+(b[i].re));
    a[i].im = ((a[i].im)+(b[i].im));
  }
}


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|i686-pc-linux-gnu           |i?86-*-* x86_64-*-*
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2008-10-07 21:04:07
               date|                            |
            Summary|ICE when compile mpich2-    |[4.4 Regression] ICE in
                   |1.1.0a1                     |vectorizer with restrict
                   |                            |pointer to struct
   Target Milestone|---                         |4.4.0


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer to struct
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (6 preceding siblings ...)
  2008-10-07 21:05 ` [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer to struct pinskia at gcc dot gnu dot org
@ 2008-10-07 21:06 ` pinskia at gcc dot gnu dot org
  2008-10-09 20:52 ` [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer reichelt at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-10-07 21:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2008-10-07 21:04 -------
Also happens on powerpc64-linux-gnu with -maltivec.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|i?86-*-* x86_64-*-*         |


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (7 preceding siblings ...)
  2008-10-07 21:06 ` pinskia at gcc dot gnu dot org
@ 2008-10-09 20:52 ` reichelt at gcc dot gnu dot org
  2008-10-10  7:51 ` rguenth at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-10-09 20:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from reichelt at gcc dot gnu dot org  2008-10-09 20:51 -------
I just stumbled over the same bug and a similar ICE in vectorizable_store:

The following valid code snippet triggers an ICE on mainline when compiled
with "-march=pentium4 -O2 -ftree-vectorize" on i686-pc-linux-gnu:

==================================================================
void foo(int* __restrict__ p, int* q, int* p1, int *q1)
{
  int i;

  p = p1;
  q = q1;

  for (i = 0; i < 4; ++i)
    *++q = *++p + 1;
}
==================================================================

bug.c: In function 'foo':
bug.c:1: internal compiler error: in vectorizable_load, at
tree-vect-transform.c:6675
Please submit a full bug report, [etc.]

Moving the restrict keyword triggers a slightly different ICE:

==================================================================
void foo(int* p, int* __restrict__ q, int* p1, int *q1)
{
  int i;

  p = p1;
  q = q1;

  for (i = 0; i < 4; ++i)
    *++q = *++p + 1;
}
==================================================================

bug.c: In function 'foo':
bug.c:1: internal compiler error: in vectorizable_store, at
tree-vect-transform.c:5447
Please submit a full bug report, [etc.]

This is a recent regression, introduced between 2008-09-29 and 2008-10-08.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored
            Summary|[4.4 Regression] ICE in     |[4.4 Regression] ICE in
                   |vectorizer with restrict    |vectorizer with restrict
                   |pointer to struct           |pointer


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (8 preceding siblings ...)
  2008-10-09 20:52 ` [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer reichelt at gcc dot gnu dot org
@ 2008-10-10  7:51 ` rguenth at gcc dot gnu dot org
  2008-10-13 21:38 ` pinskia at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-10-10  7:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2008-10-10 07:49 -------
I will have a look.


-- 

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
   Last reconfirmed|2008-10-07 21:04:07         |2008-10-10 07:49:58
               date|                            |


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (9 preceding siblings ...)
  2008-10-10  7:51 ` rguenth at gcc dot gnu dot org
@ 2008-10-13 21:38 ` pinskia at gcc dot gnu dot org
  2008-10-14 20:47 ` rguenth at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-10-13 21:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pinskia at gcc dot gnu dot org  2008-10-13 21:37 -------
*** Bug 37817 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (10 preceding siblings ...)
  2008-10-13 21:38 ` pinskia at gcc dot gnu dot org
@ 2008-10-14 20:47 ` rguenth at gcc dot gnu dot org
  2008-10-22  3:48 ` mmitchel at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-10-14 20:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2008-10-14 20:46 -------
This is because data-ref uses p1 for DR_BASE_ADDRESS instead of p (which is
restrict qualified), for the scalar load we do not do this "propagation"
because
we try to retain restrict qualifications.

simple_iv () in dr_analyze_innermost computes for the iv base

  (int * restrict) p1_4(D) + 4

and canonicalize_base_object_address gets passed (int * restrict) p1_4(D) after
splitting away the offset.  This just strips NOPs, so the restrict
qualification
gets lost here.

I have a patch.

So the assert in this case hints at a missed-optimization.


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (11 preceding siblings ...)
  2008-10-14 20:47 ` rguenth at gcc dot gnu dot org
@ 2008-10-22  3:48 ` mmitchel at gcc dot gnu dot org
  2008-11-05 12:18 ` rguenth at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2008-10-22  3:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (12 preceding siblings ...)
  2008-10-22  3:48 ` mmitchel at gcc dot gnu dot org
@ 2008-11-05 12:18 ` rguenth at gcc dot gnu dot org
  2008-11-05 12:19 ` rguenth at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-05 12:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rguenth at gcc dot gnu dot org  2008-11-05 12:17 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (13 preceding siblings ...)
  2008-11-05 12:18 ` rguenth at gcc dot gnu dot org
@ 2008-11-05 12:19 ` rguenth at gcc dot gnu dot org
  2008-11-06  1:24 ` linuxl4 at sohu dot com
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-05 12:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from rguenth at gcc dot gnu dot org  2008-11-05 12:18 -------
Subject: Bug 37742

Author: rguenth
Date: Wed Nov  5 12:17:10 2008
New Revision: 141606

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141606
Log:
2008-11-05  Richard Guenther  <rguenther@suse.de>

        PR middle-end/37742
        * tree-ssa.c (useless_type_conversion_p_1): Check different restrict
        qualified pointer conversion before stripping qualifiers.
        * gimplify.c (create_tmp_from_val): Use correctly qualified type.
        * tree-flow.h (may_propagate_address_into_dereference): Declare.
        * tree-ssa-ccp.c (may_propagate_address_into_dereference): New
function.
        (ccp_fold): Use it.
        * tree-ssa-forwprop.c (rhs_to_tree): Remove useless conversions,
        properly canonicalize binary ops.
        (forward_propagate_addr_expr_1): Use
        may_propagate_address_into_dereference.

        cp/
        * decl.c (start_preparsed_function): Use the correct type for
        building the RESULT_DECL.

        * gcc.c-torture/compile/pr37742.c: New testcase.
        * g++.dg/pr37742.C: Likewise.
        * gcc.dg/tree-ssa/forwprop-7.c: Check for two volatile loads.

Added:
    trunk/gcc/testsuite/g++.dg/pr37742.C
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37742.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tree-ssa/forwprop-7.c
    trunk/gcc/tree-flow.h
    trunk/gcc/tree-ssa-ccp.c
    trunk/gcc/tree-ssa-forwprop.c
    trunk/gcc/tree-ssa.c


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (14 preceding siblings ...)
  2008-11-05 12:19 ` rguenth at gcc dot gnu dot org
@ 2008-11-06  1:24 ` linuxl4 at sohu dot com
  2008-11-11  8:14 ` reichelt at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: linuxl4 at sohu dot com @ 2008-11-06  1:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from linuxl4 at sohu dot com  2008-11-06 01:23 -------
really ?

my gcc is r141610

[~/tmp]$gcc -O2 -march=pentium4 -ftree-vectorize opsum.c 
../../../../src/mpi/coll/opsum.c: In function 'MPIR_SUM':
../../../../src/mpi/coll/opsum.c:21: internal compiler error: in
vectorizable_load, at tree-vect-transform.c:6675
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 

linuxl4 at sohu dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |linuxl4 at sohu dot com


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (15 preceding siblings ...)
  2008-11-06  1:24 ` linuxl4 at sohu dot com
@ 2008-11-11  8:14 ` reichelt at gcc dot gnu dot org
  2008-11-18 18:27 ` jakub at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-11-11  8:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from reichelt at gcc dot gnu dot org  2008-11-11 08:12 -------
The testcase in comment #7 (and the original code in comment #4) still crashes.


-- 

reichelt at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (16 preceding siblings ...)
  2008-11-11  8:14 ` reichelt at gcc dot gnu dot org
@ 2008-11-18 18:27 ` jakub at gcc dot gnu dot org
  2008-11-18 20:14 ` jakub at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-11-18 18:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from jakub at gcc dot gnu dot org  2008-11-18 18:26 -------
Created an attachment (id=16718)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16718&action=view)
gcc44-pr37742.patch

Testcase #c7 can be fixed by this patch.  Without it, alias sets in presence of
restricted pointers act weirdly - if it is called on an INDIRECT_REF with a
SSA_NAME, it will return one alias set, but if a new INDIRECT_REF is
constructed from the SSA_NAME's var decl, then a different alias set is
returned.
Unfortunately this patch breaks bootstrap in matmul_i2.c, ICE in
vectorizable_store.


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (17 preceding siblings ...)
  2008-11-18 18:27 ` jakub at gcc dot gnu dot org
@ 2008-11-18 20:14 ` jakub at gcc dot gnu dot org
  2008-11-19 17:45 ` rguenther at suse dot de
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-11-18 20:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from jakub at gcc dot gnu dot org  2008-11-18 20:13 -------
Created an attachment (id=16719)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16719&action=view)
incremental patch

This fixed matmul_i2.c, DR_BASE_ADDRESS wasn't in this case TYPE_RESTRICT, nor
SSA_NAME, but POINTER_PLUS_EXPR, yet in the end was based on a restrict
pointer.
Unfortunately other matmul*.c stuff in libgfortran is still broken.  I'm
wondering if the strict alias checking introduced in r140781 isn't too eager
when restricted pointers are used...


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (18 preceding siblings ...)
  2008-11-18 20:14 ` jakub at gcc dot gnu dot org
@ 2008-11-19 17:45 ` rguenther at suse dot de
  2008-11-20 16:26 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenther at suse dot de @ 2008-11-19 17:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from rguenther at suse dot de  2008-11-19 17:43 -------
Subject: Re:  [4.4 Regression] ICE in vectorizer with
 restrict pointer

On Tue, 18 Nov 2008, jakub at gcc dot gnu dot org wrote:

> ------- Comment #18 from jakub at gcc dot gnu dot org  2008-11-18 20:13 -------
> Created an attachment (id=16719)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16719&action=view)
>  --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16719&action=view)
> incremental patch
> 
> This fixed matmul_i2.c, DR_BASE_ADDRESS wasn't in this case TYPE_RESTRICT, nor
> SSA_NAME, but POINTER_PLUS_EXPR, yet in the end was based on a restrict
> pointer.
> Unfortunately other matmul*.c stuff in libgfortran is still broken.  I'm
> wondering if the strict alias checking introduced in r140781 isn't too eager
> when restricted pointers are used...

It can/should be relaxed to do an alias_sets_conflict_p check instead of
the subset check.  No idea if that helps - but also the patch at
http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00286.html should fix all
of the current issues (maybe not optimally though).

Note that I added the alias checks to catch wrong-code issues.

Richard.


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (19 preceding siblings ...)
  2008-11-19 17:45 ` rguenther at suse dot de
@ 2008-11-20 16:26 ` rguenth at gcc dot gnu dot org
  2008-11-20 17:17 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-20 16:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from rguenth at gcc dot gnu dot org  2008-11-20 16:25 -------
Reduced testcase for the libgfortran failure (-O2 -ftree-vectorize):

void matmul_i4 (int * __restrict dest_y,
                const int * __restrict abase,
                const int * __restrict bbase_y,
                int count, int xcount, int ycount, int aystride)
{               
  int x, y, n;
  const int * __restrict abase_n;
  int bbase_yn;
  for (y = 0; y < ycount; y++)
    for (n = 0; n < count; n++) {
        abase_n = abase + n*aystride;
        bbase_yn = bbase_y[n];
        for (x = 0; x < xcount; x++)
          dest_y[x] += abase_n[x] * bbase_yn; 
    }
}


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (20 preceding siblings ...)
  2008-11-20 16:26 ` rguenth at gcc dot gnu dot org
@ 2008-11-20 17:17 ` rguenth at gcc dot gnu dot org
  2008-11-20 17:23 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-20 17:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from rguenth at gcc dot gnu dot org  2008-11-20 17:15 -------
The problem with our restrict handling seems to be "deeper".  We fail to set
the based-on-restrict property properly.

  abase_n{4}_13 = abase{-2}_12(D) + D.1614_11;

so here abase_n and abase are not properly connected...  unfortunately that
seems to be a very deep rooted problem (and obviously our restrict handling
is broken anyway ...)


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (21 preceding siblings ...)
  2008-11-20 17:17 ` rguenth at gcc dot gnu dot org
@ 2008-11-20 17:23 ` rguenth at gcc dot gnu dot org
  2008-11-21 11:11 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-20 17:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from rguenth at gcc dot gnu dot org  2008-11-20 17:22 -------
For 4.4 I will collect the fixes and just disable the assertion...  we cannot
fix this properly without switching to a completely points-to based restrict
implementation (lumping restrict together with TBAA info is fundamentally
broken anyway).


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (22 preceding siblings ...)
  2008-11-20 17:23 ` rguenth at gcc dot gnu dot org
@ 2008-11-21 11:11 ` rguenth at gcc dot gnu dot org
  2008-11-28 11:32 ` rguenth at gcc dot gnu dot org
  2008-11-28 11:33 ` rguenth at gcc dot gnu dot org
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-21 11:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from rguenth at gcc dot gnu dot org  2008-11-21 11:09 -------
We actually usually never ask for the alias set of an indirect reference, but
instead we seem to use the pointed-to type instead which doesn't inherit the
restrict handling.  Otherwise we would miscompile even the trivial

int foo (int *__restrict p)
{
  int *__restrict q;
  int v;
  q = p + 1;
  q = q - 1;
  v = *q;
  *p = 1;
  return v + *q;
}
extern void abort (void);
int main()
{
  int i = 0;
  if (foo (&i) != 1)
    abort ();
  return 0;
}

because q is not based on the restrict p and both pointers would get
distinct alias-sets which you can verify by calling get_alias_set on
the indirect-refs.

So one way to fix the issue in the vectorizer is to avoid calling
get_alias_set on the indirect-refs as well.  Or to rip out all the
broken restrict handling from the compiler.


-- 


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (23 preceding siblings ...)
  2008-11-21 11:11 ` rguenth at gcc dot gnu dot org
@ 2008-11-28 11:32 ` rguenth at gcc dot gnu dot org
  2008-11-28 11:33 ` rguenth at gcc dot gnu dot org
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-28 11:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from rguenth at gcc dot gnu dot org  2008-11-28 11:30 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer
  2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
                   ` (24 preceding siblings ...)
  2008-11-28 11:32 ` rguenth at gcc dot gnu dot org
@ 2008-11-28 11:33 ` rguenth at gcc dot gnu dot org
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-28 11:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from rguenth at gcc dot gnu dot org  2008-11-28 11:32 -------
Subject: Bug 37742

Author: rguenth
Date: Fri Nov 28 11:30:45 2008
New Revision: 142257

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142257
Log:
2008-11-28  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/37955
        PR tree-optimization/37742
        * tree-vect-transform.c (vectorizable_store): Remove assert for
        compatible aliases.
        (vectorizable_load): Likewise.

        * gcc.c-torture/compile/pr37955.c: New testcase.
        * gcc.c-torture/compile/pr37742-3.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37742-3.c
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37955.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-transform.c


-- 


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


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

end of thread, other threads:[~2008-11-28 11:33 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-06  5:18 [Bug middle-end/37742] New: ICE when compile mpich2-1.1.0a1 linuxl4 at sohu dot com
2008-10-06 15:56 ` [Bug middle-end/37742] " rguenth at gcc dot gnu dot org
2008-10-06 16:22 ` linuxl4 at sohu dot com
2008-10-06 16:33 ` jakub at gcc dot gnu dot org
2008-10-07  5:03 ` linuxl4 at sohu dot com
2008-10-07  5:08 ` linuxl4 at sohu dot com
2008-10-07 20:47 ` pinskia at gcc dot gnu dot org
2008-10-07 21:05 ` [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer to struct pinskia at gcc dot gnu dot org
2008-10-07 21:06 ` pinskia at gcc dot gnu dot org
2008-10-09 20:52 ` [Bug middle-end/37742] [4.4 Regression] ICE in vectorizer with restrict pointer reichelt at gcc dot gnu dot org
2008-10-10  7:51 ` rguenth at gcc dot gnu dot org
2008-10-13 21:38 ` pinskia at gcc dot gnu dot org
2008-10-14 20:47 ` rguenth at gcc dot gnu dot org
2008-10-22  3:48 ` mmitchel at gcc dot gnu dot org
2008-11-05 12:18 ` rguenth at gcc dot gnu dot org
2008-11-05 12:19 ` rguenth at gcc dot gnu dot org
2008-11-06  1:24 ` linuxl4 at sohu dot com
2008-11-11  8:14 ` reichelt at gcc dot gnu dot org
2008-11-18 18:27 ` jakub at gcc dot gnu dot org
2008-11-18 20:14 ` jakub at gcc dot gnu dot org
2008-11-19 17:45 ` rguenther at suse dot de
2008-11-20 16:26 ` rguenth at gcc dot gnu dot org
2008-11-20 17:17 ` rguenth at gcc dot gnu dot org
2008-11-20 17:23 ` rguenth at gcc dot gnu dot org
2008-11-21 11:11 ` rguenth at gcc dot gnu dot org
2008-11-28 11:32 ` rguenth at gcc dot gnu dot org
2008-11-28 11:33 ` 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).