Bug 21274 - SSA Crash, reproducable
Summary: SSA Crash, reproducable
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-04-29 04:50 UTC by Michael Callahan
Modified: 2005-09-13 19:48 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-13 19:45:09


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Callahan 2005-04-29 04:50:13 UTC
The g++-4.0 in the Ubuntu Hoary repository crashes on the following file.



------- crash-4.0.cc starts here ---------------------------------------
/*

prompt> g++-4.0 -msse2 -O3 -ftree-vectorize -ftree-vectorizer-verbose=5 -c
crash-4.0.cc
crash-4.0.cc:11: note: Alignment of access forced using peeling.
crash-4.0.cc:11: note: LOOP VECTORIZED.
crash-4.0.cc:26: note: Alignment of access forced using peeling.crash-4.0.cc: In
function ‘DenseMatrix* mat_identity(int)’:
crash-4.0.cc:21: internal compiler error: in gimplify_expr, at gimplify.c:4070
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>.

prompt> g++-4.0 --version
 g++-4.0 (GCC) 4.0.0 20050301 (prerelease) (Debian 4.0-0pre6ubuntu7)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

prompt> uname -a
Linux tamale 2.6.10-5-amd64-generic #1 Tue Apr 5 12:21:57 UTC 2005 x86_64 GNU/Linux

*/

class DenseMatrix
{
  int rows_, cols_;
  double *ptr_;
public:
  DenseMatrix(int nr, int nc) : rows_(nr), cols_(nc)
  {
    ptr_ = new double[nr * nc];
  }
  
  void zero() { for (int i = 0; i < rows_ * cols_; i++) ptr_[i] = 0.0; } 

  inline double* operator[](int r)
  {
    return ptr_ + r * cols_;
  }
};


//! Create Identity Matrix
DenseMatrix *mat_identity(int len) 
{
  DenseMatrix *eye = new DenseMatrix(len, len);

  eye->zero();
  for (int i=0; i<len; i++)
  {
    (*eye)[i][i]=1;
  }
  return eye;
}
Comment 1 Andrew Pinski 2005-04-29 07:14:31 UTC
Hmm, "4.0.0 20050301", I am thinking you should try a 4.0.0 release compiler.
Comment 2 Michael Callahan 2005-04-29 13:57:37 UTC
Not me.  I have lots to do and this is relatively unimportant.  I just thought
someone there might like the short test case.
Comment 3 Dorit Naishlos 2005-05-02 16:27:06 UTC
Thanks for the testcase.

I tried reproducing the problem on i686-pc-linux-gnu with today's snapshot of 
4.1, and also with today's snapshot of 4.0 (gcc version 4.0.1 20050502 
(prerelease)) - I can't reproduce it with these snapshots. Maybe the problem 
had already been solved. Just FYI, I get:
"
pr21274.cc:11: note: Alignment of access forced using peeling.
pr21274.cc:11: note: LOOP VECTORIZED.

pr21274.cc:26: note: not vectorized: pointer access is not simple.
pr21274.cc:26: note: not vectorized: unhandled data ref: *D.1981_38 = 1.0e+0

pr21274.cc:21: note: vectorized 1 loops in function.
"

Which means we don't try to peel the loop in line 26 anymore (from your report 
it looks like we used to peel that loop with the snapshot you are using:
"crash-4.0.cc:26: note: Alignment of access forced using peeling.crash-4.0.cc")
Comment 4 Michael Callahan 2005-05-02 16:36:22 UTC
I suspect that this is an x86-64 bug.

I have a different computer available to me here.  I get the same result as
Dorit.  Note that it appears to be the same Ubuntu beta version as the x86-64
version.  I recommend have someone run it on a recent x86-64 and if it's not a
problem there then just close out the bug.


callahan@carnitas:/tmp$ g++-4.0 -msse2 -O3 -ftree-vectorize
-ftree-vectorizer-verbose=5 -c testcast.o testcast.cc
g++-4.0: testcast.o: No such file or directory

testcast.cc:11: note: Alignment of access forced using peeling.
testcast.cc:11: note: LOOP VECTORIZED.
testcast.cc:26: note: not vectorized: pointer access is not simple.
testcast.cc:26: note: not vectorized: unhandled data ref: *D.1981_38 = 1.0e+0
testcast.cc:21: note: vectorized 1 loops in function.
callahan@carnitas:/tmp$ g++-4.0 --version
g++-4.0 (GCC) 4.0.0 20050301 (prerelease) (Debian 4.0-0pre6ubuntu7)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 5 Michael Callahan 2005-09-13 19:32:17 UTC
Subject: Re:  SSA Crash, reproducable

This still crashes for me with the latest Ubuntu g++ build.

g++ (GCC) 4.0.2 20050808 (prerelease) (Debian 4.0.1-4ubuntu6)

The error is the same, but the crash is line 4186.

  Michael

On Mon, 2005-05-02 at 16:36 +0000, callahan at sci dot utah dot edu
wrote:
> ------- Additional Comments From callahan at sci dot utah dot edu  2005-05-02 16:36 -------
> I suspect that this is an x86-64 bug.
> 
> I have a different computer available to me here.  I get the same result as
> Dorit.  Note that it appears to be the same Ubuntu beta version as the x86-64
> version.  I recommend have someone run it on a recent x86-64 and if it's not a
> problem there then just close out the bug.
> 
> 
> callahan@carnitas:/tmp$ g++-4.0 -msse2 -O3 -ftree-vectorize
> -ftree-vectorizer-verbose=5 -c testcast.o testcast.cc
> g++-4.0: testcast.o: No such file or directory
> 
> testcast.cc:11: note: Alignment of access forced using peeling.
> testcast.cc:11: note: LOOP VECTORIZED.
> testcast.cc:26: note: not vectorized: pointer access is not simple.
> testcast.cc:26: note: not vectorized: unhandled data ref: *D.1981_38 = 1.0e+0
> testcast.cc:21: note: vectorized 1 loops in function.
> callahan@carnitas:/tmp$ g++-4.0 --version
> g++-4.0 (GCC) 4.0.0 20050301 (prerelease) (Debian 4.0-0pre6ubuntu7)
> Copyright (C) 2005 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 

Comment 6 Andrew Pinski 2005-09-13 19:45:09 UTC
Hmm, we are trying to gimplify a SCEV tree:
(<unnamed type>) ((long unsigned intD.7) {0, +, D.2009_8}_2 * 8)
Comment 7 Andrew Pinski 2005-09-13 19:48:09 UTC
Fixed on the mainline and since this is not a regression closing as fixed.

Fixed with 4.1.0 20050802 and 4.1.0 20050714.
Comment 8 Frank Ch. Eigler 2006-06-21 16:35:50 UTC
Subject: Bug 21274

Author: fche
Date: Wed Jun 21 16:35:27 2006
New Revision: 114855

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114855
Log:
2006-06-21  Frank Ch. Eigler  <fche@redhat.com>

	PR 21274
	mf-runtime.h installation based on ssp patch for PR 26473 from
	Mark Mitchell  <mark@codesourcery.com>.
	* configure.ac (ACX_NONCANONICAL_TARGET): Use it.
	* Makefile.am (target_noncanonical): Define.
	(libsubincludedir): New variable.
	(nobase_libsubinclude_HEADERS): Add mf-runtime.h.
	(include_HEADERS): Remove.
	* configure, aclocal.m4, config.h.in: Regenerated.
	* Makefile.in, testsuite/Makefile.in: Likewise.
	* mf-runtime.h: Add #ifndef protection for conflicting _REENTRANT
	and _THREAD_SAFE redefinition values.


Modified:
    trunk/libmudflap/ChangeLog
    trunk/libmudflap/Makefile.am
    trunk/libmudflap/Makefile.in
    trunk/libmudflap/aclocal.m4
    trunk/libmudflap/config.h.in
    trunk/libmudflap/configure
    trunk/libmudflap/configure.ac
    trunk/libmudflap/mf-runtime.h
    trunk/libmudflap/testsuite/Makefile.in