public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/27753]  New: ICE in make_ssa_name on autovect-branch
@ 2006-05-24 10:45 gcc at pdoerfler dot com
  2006-05-24 11:41 ` [Bug tree-optimization/27753] " gcc at pdoerfler dot com
  2009-02-06 22:17 ` steven at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: gcc at pdoerfler dot com @ 2006-05-24 10:45 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]

/usr/local/vect/bin/g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-vect/configure --enable-languages=c,c++
--prefix=/usr/local/vect
Thread model: posix
gcc version 4.2.0-autovect 20060518 (experimental)

Reduced testcase below ICEs:
/usr/local/vect/bin/g++ -O3 -ftree-vectorize -march=pentium-m -c vecreduced.cpp
vecreduced.cpp: In member function ‘vector<T>& vector<T>::add(T) [with T =
ppoint<int>]’:
vecreduced.cpp:14: internal compiler error: in make_ssa_name, at
tree-ssanames.c:129

========================================================
template <class T>
struct ppoint {
  int x, y;
  inline ppoint<T>& operator+=(const ppoint<T>& p) {
    x+=p.x;
    y+=p.y;
    return *this;
  }
};

template<typename T>
class vector {
public:
  vector<T>& add(T cst) {
    for (int i=0; i<vectorSize_; i++) {
      theElements_[i]+=cst;
    }
    return *this;
  }
private:
  int vectorSize_;
  T* theElements_;
};

template class vector<ppoint<int> >;
========================================================


-- 
           Summary: ICE in make_ssa_name on autovect-branch
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at pdoerfler dot com
  GCC host triplet: i686-pc-linux-gnu


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


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

* [Bug tree-optimization/27753] ICE in make_ssa_name on autovect-branch
  2006-05-24 10:45 [Bug tree-optimization/27753] New: ICE in make_ssa_name on autovect-branch gcc at pdoerfler dot com
@ 2006-05-24 11:41 ` gcc at pdoerfler dot com
  2009-02-06 22:17 ` steven at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: gcc at pdoerfler dot com @ 2006-05-24 11:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from gcc at pdoerfler dot com  2006-05-24 11:41 -------
This is probably related to or a duplicate of PR26362.
Anyways, this is now a C++ testcase instead of fortran.

The patch by rth posted in that PR makes the ICE go away. 
Here is an updated version that applies cleanly:

Index: targhooks.c
===================================================================
--- targhooks.c (revision 114040)
+++ targhooks.c (working copy)
@@ -455,7 +455,8 @@
   tree type;
   enum machine_mode mode;
   block_stmt_iterator bsi;
-  tree th, tl, result, x;
+  tree t1, t2, x;
+  int i, n;

   /* If the first argument is a type, just check if support
      is available. Return a non NULL value if supported, NULL_TREE otherwise.
@@ -479,31 +480,36 @@
     return NULL;

   bsi = bsi_for_stmt (stmt);
-
-  th = make_rename_temp (type, NULL);
-  x = build2 (VEC_INTERLEAVE_HIGH_EXPR, type, vec1, vec2);
-  x = build2 (MODIFY_EXPR, type, th, x);
-  th = make_ssa_name (th, x);
-  TREE_OPERAND (x, 0) = th;
-  bsi_insert_before (&bsi, x, BSI_SAME_STMT);
+  n = exact_log2 (GET_MODE_NUNITS (mode)) - 1;
+  for (i = 0; i < n; ++i)
+    {
+      t1 = create_tmp_var (type, NULL);
+      add_referenced_tmp_var (t1);
+      x = build2 (VEC_INTERLEAVE_HIGH_EXPR, type, vec1, vec2);
+      x = build2 (MODIFY_EXPR, type, t1, x);
+      t1 = make_ssa_name (t1, x);
+      TREE_OPERAND (x, 0) = t1;
+      bsi_insert_before (&bsi, x, BSI_SAME_STMT);

-  tl = make_rename_temp (type, NULL);
-  x = build2 (VEC_INTERLEAVE_LOW_EXPR, type, vec1, vec2);
-  x = build2 (MODIFY_EXPR, type, tl, x);
-  tl = make_ssa_name (tl, x);
-  TREE_OPERAND (x, 0) = tl;
-  bsi_insert_before (&bsi, x, BSI_SAME_STMT);
+      t2 = create_tmp_var (type, NULL);
+      add_referenced_tmp_var (t2);
+      x = build2 (VEC_INTERLEAVE_LOW_EXPR, type, vec1, vec2);
+      x = build2 (MODIFY_EXPR, type, t2, x);
+      t2 = make_ssa_name (t2, x);
+      TREE_OPERAND (x, 0) = t2;
+      bsi_insert_before (&bsi, x, BSI_SAME_STMT);

-  result = make_rename_temp (type, NULL);
-  /* ??? Endianness issues?  */
+      if (BYTES_BIG_ENDIAN)
+                vec1 = t1, vec2 = t2;
+      else
+                vec1 = t2, vec2 = t1;
+    }
+
   x = build2 (odd_p ? VEC_INTERLEAVE_HIGH_EXPR : VEC_INTERLEAVE_LOW_EXPR,
-             type, th, tl);
-  x = build2 (MODIFY_EXPR, type, result, x);
-  result = make_ssa_name (result, x);
-  TREE_OPERAND (x, 0) = result;
-  bsi_insert_before (&bsi, x, BSI_SAME_STMT);
+                      type, vec1, vec2);
+  x = build2 (MODIFY_EXPR, type, dest, x);

-  return result;
+  return x;
 }

 tree


-- 


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


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

* [Bug tree-optimization/27753] ICE in make_ssa_name on autovect-branch
  2006-05-24 10:45 [Bug tree-optimization/27753] New: ICE in make_ssa_name on autovect-branch gcc at pdoerfler dot com
  2006-05-24 11:41 ` [Bug tree-optimization/27753] " gcc at pdoerfler dot com
@ 2009-02-06 22:17 ` steven at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-02-06 22:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from steven at gcc dot gnu dot org  2009-02-06 22:16 -------
Looks like it really was a dup. Can't reproduce it anymore now, anyway.


-- 

steven at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-02-06 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-24 10:45 [Bug tree-optimization/27753] New: ICE in make_ssa_name on autovect-branch gcc at pdoerfler dot com
2006-05-24 11:41 ` [Bug tree-optimization/27753] " gcc at pdoerfler dot com
2009-02-06 22:17 ` steven 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).