------- Comment #18 from hjl at lucon dot org  2007-04-18 20:02 -------
(In reply to comment #17)
> Testcase in comment #16 failed on ia32, x86-64 and ia64 with -O3. 051t.alias3
> dump looks strange. 102t.final_cleanup dump is:
> 
> [EMAIL PROTECTED] bad]$ cat x.cc.102t.final_cleanup
> 
> ;; Function int main() (main)
> 
> int main() ()
> {
>   int SR.19;
> 
> <bb 2>:
>   return SR.19 == 1 == 0;
> 
> }
> [EMAIL PROTECTED] bad]$
> 

I used a modified version to return 0 when success:

[EMAIL PROTECTED] 30567]$ cat x.cc
template <typename T>
struct const_ref
{
  const T* begin;
  const_ref(const T* b) : begin(b) {}
};

template <typename T>
T sum(const_ref<T> const& a)
{
  T result = 0;
  for(unsigned i=0;i<1;i++) result += a.begin[i];
  return result;
}

struct tiny_plain
{
  int elems[2];
  tiny_plain() { elems[0]=1; }
};

struct vec3 : tiny_plain {};

struct mat3
{
  int type() const { return sum(const_ref<int>(vec3().elems)) == 1; }
};

int main() { return mat3().type() ? 0 :1; }
[EMAIL PROTECTED] 30567]$


-- 


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

Reply via email to