[Bug other/14708] description of -ffloat-store in gcc man page incorrect/inaccurate

2004-12-08 Thread vincent at vinc17 dot org

--- Additional Comments From vincent at vinc17 dot org  2004-12-08 15:13 
---
I'm wrong. gcc 3.4 (from Debian) still has this problem. So, -ffloat-store is
still needed for C compliance.

-- 


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

--- You are receiving this mail because: ---
You reported the bug, or are watching the reporter.




Bug#284777: g++-3.4: internal compiler error: in uses_template_parms at cp/pt.c:4860

2004-12-08 Thread Markus Blatt
Package: g++-3.4
Version: 3.4.2-2
Severity: important

Hi, 

the following (error prone) C++ code triggers an internal compiler error in
uses_template_parms, at cp/pt.c:4860


template
struct Dummy
{
  void evil()
  {
this->template tester();
  }

  template
  void tester()
  {
// evil should actually be a bool  
bar()();
  }
  template
  struct bar
  {
void operator()()
{ }
  };
};

int main()
{}

If class Dummy is not a template class the code triggers no internal compiler 
error
but the following error message:

testcase1.cc: In member function `void Dummy::tester()':
testcase1.cc:12: error: `void Dummy::evil()' cannot appear in a 
constant-expression
testcase1.cc:12: error: template argument 1 is invalid

Cheers,

Markus Blatt

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27thinkpad
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages g++-3.4 depends on:
ii  gcc-3.4 3.4.2-2  The GNU C compiler
ii  gcc-3.4-base3.4.2-2  The GNU Compiler Collection (base 
ii  libc6   2.3.2.ds1-18 GNU C Library: Shared libraries an
ii  libstdc++6-dev  3.4.2-2  The GNU Standard C++ Library v3 (d

-- no debconf information




Re: Bug#284793: libc6-prof: Running programs compiled with -profile fails

2004-12-08 Thread Daniel Jacobowitz
On Wed, Dec 08, 2004 at 09:17:39PM +0100, Arno Wagner wrote:
> E ~/exp/c/misc>gcc -profile hello.c 
> E ~/exp/c/misc>a.out
> Inconsistency detected by ld.so: dl-version.c: 230: _dl_check_map_versions: 
> Assertion `needed != ((void *)0)' failed!
> E ~/exp/c/misc>

This has got to be either a GCC or binutils bug.  The link line is:

 /usr/lib/gcc-lib/i486-linux/3.3.5/collect2 --eh-frame-hdr -m elf_i386
 -dynamic-linker /lib/ld-linux.so.2
 /usr/lib/gcc-lib/i486-linux/3.3.5/../../../gcrt1.o
 /usr/lib/gcc-lib/i486-linux/3.3.5/../../../crti.o
 /usr/lib/gcc-lib/i486-linux/3.3.5/crtbegin.o
 -L/usr/lib/gcc-lib/i486-linux/3.3.5
 -L/usr/lib/gcc-lib/i486-linux/3.3.5/../../.. /tmp/ccNEb3Zl.o -lgcc
 --as-needed -lgcc_s --no-as-needed -lc_p -lgcc --as-needed -lgcc_s
 --no-as-needed /usr/lib/gcc-lib/i486-linux/3.3.5/crtend.o
 /usr/lib/gcc-lib/i486-linux/3.3.5/../../../crtn.o

But somehow a.out has a DT_NEEDED entry for libc.so.6.  I see two
problems:

1. It looks like --as-needed -lgcc_s --no-as-needed has somehow dragged in
libc.so.6, even though libgcc_s.so is not needed (and not referenced by
the output).

2. Should GCC add -static automatically to -profile, since libc_p.a is
a static library?  You can't link libc statically to a dynamic
executable.

-- 
Daniel Jacobowitz




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread steven at gcc dot gnu dot org

--- Additional Comments From steven at gcc dot gnu dot org  2004-12-08 
22:18 ---
extern int printf (__const char *__restrict __format, ...); 
 
void 
divisors_bug(long *t, long e, long P) 
{ 
  long j; 
  long *d, *old_d, *act_d, *tmp; 
 
  d = t; 
  *++d = 5; 
  old_d = t; 
  for (j = e; j; j--) 
{ 
  act_d = d; 
  tmp = old_d; 
  while (tmp < act_d) 
*++d = *(++tmp); 
  old_d=act_d; 
} 
} 
 
int main(void) 
{ 
  long t[4]; 
  long i; 
 
  divisors_bug(t,2,2); 
  for(i=1;i<4;i++) 
printf("%ld ",t[i]); 
  printf("\n"); 
  return 0; 
} 
 
Expected output: 5 5 5 
Output with -O1: 5 5 garbage 
 

-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




Results for 3.3.5 (Debian 1:3.3.5-3) testsuite on s390-linux

2004-12-08 Thread Matthias Klose
LAST_UPDATED: Sat Dec  4 07:38:33 UTC 2004

Native configuration is s390-linux (lnxdeb02)

=== gpc tests ===


Running target any

=== gpc Summary ===

# of tests3910
# of expected passes  3905
# of unsupported tests5
/home/ton/gcc-3.3-3.3.5/build/gcc/xgpc version 20040516, based on gcc-3.3.5 
(Debian 1:3.3.5-3)

=== g++ tests ===


Running target unix
XPASS: g++.other/init5.C  Execution test

=== g++ Summary ===

# of expected passes8205
# of unexpected successes   1
# of expected failures  97
# of untested testcases 23
# of unsupported tests  29
/home/ton/gcc-3.3-3.3.5/build/gcc/testsuite/../g++ version 3.3.5 (Debian 
1:3.3.5-3)

=== g77 tests ===


Running target unix

=== g77 Summary ===

# of expected passes1720
# of unsupported tests  8
/home/ton/gcc-3.3-3.3.5/build/gcc/testsuite/../g77 version 3.3.5 (Debian 
1:3.3.5-3)

=== gcc tests ===


Running target unix
FAIL: gcc.dg/debug/debug-1.c -gstabs -O3 scan-assembler xyzzy
FAIL: gcc.dg/debug/debug-1.c -gstabs3 -O3 scan-assembler xyzzy
FAIL: gcc.dg/debug/debug-1.c -gstabs+ -O3 scan-assembler xyzzy
FAIL: gcc.dg/debug/debug-1.c -gstabs+3 -O3 scan-assembler xyzzy
FAIL: gcc.dg/debug/debug-2.c -gstabs -O3 scan-assembler xyzzy
FAIL: gcc.dg/debug/debug-2.c -gstabs3 -O3 scan-assembler xyzzy
FAIL: gcc.dg/debug/debug-2.c -gstabs+ -O3 scan-assembler xyzzy
FAIL: gcc.dg/debug/debug-2.c -gstabs+3 -O3 scan-assembler xyzzy
FAIL: gcc.dg/duff-2.c (test for excess errors)

=== gcc Summary ===

# of expected passes21196
# of unexpected failures9
# of expected failures  70
# of unsupported tests  196
/home/ton/gcc-3.3-3.3.5/build/gcc/xgcc version 3.3.5 (Debian 1:3.3.5-3)

=== objc tests ===


Running target unix

=== objc Summary ===

# of expected passes1166
/home/ton/gcc-3.3-3.3.5/build/gcc/xgcc version 3.3.5 (Debian 1:3.3.5-3)

=== treelang tests ===


Running target unix

=== treelang Summary ===

# of expected passes1
=== libjava tests ===


Running target unix
WARNING: program timed out.
FAIL: SyncTest execution - gij test
WARNING: program timed out.
FAIL: SyncTest execution - gij test

=== libjava Summary ===

# of expected passes2987
# of unexpected failures2
# of expected failures  16
# of untested testcases 14
=== libstdc++-v3 tests ===


Running target unix
XPASS: 22_locale/collate_byname.cc execution test
XPASS: 22_locale/collate_members_char.cc execution test
XPASS: 22_locale/collate_members_wchar_t.cc execution test
XPASS: 22_locale/ctype_is_char.cc execution test
XPASS: 22_locale/ctype_is_wchar_t.cc execution test
XPASS: 22_locale/members.cc execution test
XPASS: 22_locale/messages_byname.cc execution test
XPASS: 22_locale/messages_members_char.cc execution test
XPASS: 22_locale/money_get_members_char.cc execution test
XPASS: 22_locale/money_get_members_wchar_t.cc execution test
XPASS: 22_locale/money_put_members_char.cc execution test
XPASS: 22_locale/money_put_members_wchar_t.cc execution test
XPASS: 22_locale/moneypunct_byname.cc execution test
XPASS: 22_locale/moneypunct_members_char.cc execution test
XPASS: 22_locale/moneypunct_members_wchar_t.cc execution test
XPASS: 22_locale/num_get_members_char.cc execution test
XPASS: 22_locale/num_get_members_wchar_t.cc execution test
XPASS: 22_locale/num_put_members_char.cc execution test
XPASS: 22_locale/num_put_members_wchar_t.cc execution test
XPASS: 22_locale/numpunct_byname.cc execution test
XPASS: 22_locale/numpunct_members_char.cc execution test
XPASS: 22_locale/numpunct_members_wchar_t.cc execution test
XPASS: 22_locale/time_get_members_char.cc execution test
XPASS: 22_locale/time_get_members_wchar_t.cc execution test
XPASS: 22_locale/time_put_members_char.cc execution test
XPASS: 22_locale/time_put_members_wchar_t.cc execution test
WARNING: program timed out.
FAIL: 27_io/filebuf_members.cc execution test

=== libstdc++-v3 Summary ===

# of expected passes452
# of unexpected failures1
# of unexpected successes   26
# of expected failures  2

Compiler version: 3.3.5 (Debian 1:3.3.5-3) 
Platform: s390-linux
configure flags: --host=s390-linux -v 
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib 
--enable-nls --without-included-gettext --enable-__cxa_atexit 
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm 
--enable-java-awt=xlib --enable-objc-gc
BOOT_CFLAGS=-g -O2 


Build Dependencies:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Ha

[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2004-12-09 00:47 
---
I took Steven's testcase in comment #12,
fed into GCC,
took its .t13.cfg output,
reformatted into C code,
fed that back into GCC with -O0,
and now I get the "5 5 garbage".

I separated main() to a separate file by the way.
Otherwise, I don't see the problem. 

int
divisors_bug (int *t, int e)
{
  int * d;
  int * ivtmp7;
  int * D1176;
  unsigned int ivtmp14;
  int * d22;
  unsigned int e0;
  int D1132;

  d = t + 1;
  *d = 5;
  if (e != 0) goto L2; else goto L7;

 L22:;
  ivtmp7 = D1176;

 L1:;
  d22 = d22 + 1;
  D1176 = ivtmp7 + 1;
  D1132 = *D1176;
  *d22 = D1132;
  if (d > D1176) goto L22; else goto L3;

 L3:;
  ivtmp14 = 0;

 L24:;
  ivtmp14 = ivtmp14 + 1;
  e0 = (unsigned int) e;
  if (e0 != ivtmp14) goto L24; else goto L7;

 L2:;
  if (t < d) goto L23; else goto L3;

 L23:;
  d22 = d;
  ivtmp7 = t;
  goto L1;

 L7:;
  return;
}



-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2004-12-09 00:58 
---
Forget about comment #13.
My bad.


-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09 
01:01 ---
(In reply to comment #12)
Here is a testcase which might be slightly easy to understand it should do 
(removes *a++):
extern int printf (__const char *__restrict __format, ...); 
 
void 
divisors_bug(long *t, long e, long P) 
{ 
  long int * tmp;
  long int * act_d;
  long int * old_d;
  long int * d;
  long int j;
  
  d = t + 1;
  *d = 5;
  old_d = t;
  j = e;
  while (j != 0) {
act_d = d;
tmp = old_d;
while (tmp < act_d) {
  d++;
  tmp++;
  *d = *tmp;
}
old_d = act_d;
j--;
  }
} 
 
int main(void) 
{ 
  long t[4]; 
  long i; 
  divisors_bug(t,2,2); 
  for(i=1;i<4;i++) 
printf("%ld ",t[i]); 
  printf("\n"); 
  return 0; 
} 


-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2004-12-09 01:32 
---
Here is a complete testcase that fails at DOM1.
With -O0, this testcase prints "5 5 5".
With -O1, this testcase prints "5 5 0".

I generated this testcase from final_cleanup after disabling DOM[123].

extern int printf (__const char *__restrict __format, ...); 
 
void
divisors_bug (int *t, unsigned int e)
{
  int * d23;
  unsigned int ivtmp14;
  int * ivtmp7;
  int * d;
  int * tmp;

  d23 = t + 1;
  *d23 = 5;
  if (e != 0) goto L24; else goto L6;

L24:
  tmp = t;
  d = d23;
  ivtmp14 = 0;
  goto L2;

L22:
  ivtmp7 = tmp;

L1:
  d23 = d23 + 1;
  *d23 = *(ivtmp7 + 1);
  ivtmp7 = ivtmp7 + 1;
  if (d > ivtmp7) goto L1; else goto L4;

L4:
  ivtmp14 = ivtmp14 + 1;
  if (e != ivtmp14) goto L23; else goto L6;

L23:
  tmp = d;
  d = d23;

L2:
  if (d > tmp) goto L22; else goto L4;

L6:
  return;
}

int
main (void)
{
  int t[4];
  int i;

  divisors_bug (t,2);
  for(i = 1; i < 4; i++)
printf ("%d ", t[i]);
  printf ("\n");
  return 0;
}

-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09 
01:33 ---
And here is a testcase which aborts and it is independent of storing to memory:
extern void abort (void);

void 
divisors_bug(long t, long e, long P) 
{ 
  long int tmp;
  long int act_d;
  long int old_d;
  long int d;
  long int j;
  
  d = t + 1;
  old_d = t;
  j = e;
  while (j != 0) {
act_d = d;
tmp = old_d;
while (tmp < act_d) {
  d++;
  tmp++;
}
if (tmp != act_d)
  abort ();
old_d = act_d;
j--;
  }
} 
 
int main(void) 
{
  divisors_bug(0,2,2); 
  return 0; 
} 

-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09 
01:46 ---
(In reply to comment #16)
> Here is a complete testcase that fails at DOM1.
> With -O0, this testcase prints "5 5 5".
> With -O1, this testcase prints "5 5 0".
> 
> I generated this testcase from final_cleanup after disabling DOM[123].

Lets look at the SSA level for this:
L23:;
  tmp_15 = d_5;
  d_16 = d23_2;

  # ivtmp14_6 = PHI ;
  # d_5 = PHI ;
  # tmp_4 = PHI ;
  # d23_3 = PHI ;
L2:;
  if (tmp_4 < d_5) goto L22; else goto L4;


See we know that this if condition cannot be proven false or true but DOM 
thinks is false always coming 
from BB 5 (aka L23).

[20:45] < kazu> if you are coming from bb 1, the condition is ultimately tmp_11 
< d_12.  From bb 5, 
the condition is ultimately tmp_15 < d_16.


-- 
   What|Removed |Added

 CC||law at gcc dot gnu dot org


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2004-12-09 02:14 
---
DOM1 is translating tmp_4 < d_5 (in L2:) into d23_2 < d23_2,
which would be false.

So the threader itself doesn't seem to be broken.  Something else is.



-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2004-12-09 02:51 
---
Here are the PHI nodes that I am getting at L2 in thread_across_edge
called on edge L23 -> L2.

TMT.0_24 = PHI ;
ivtmp14_6 = PHI <0(1), ivtmp14_14(5)>;
d_5 = PHI ;   <- defined
tmp_4 = PHI ; <- used
d23_3 = PHI ;

Note that d_5 is defined *and* used.
At this point, it's not safe to use SSA_NAME_VALUE for d_5.


-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2004-12-09 03:26 
---
I meant:
At this point, it's not safe to use SSA_NAME_VALUE for tmp_4.

Maybe we shouldn't add equivalence of tmp_4 and d_5 in the first place
if d_5 is also defined in a PHI node at the same BB.


-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2004-12-09 03:35 
---
Created an attachment (id=7710)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7710&action=view)
a patch

This patch is fixes the bug but maybe a bit too conservative.

If thread_across_edge gets a comparison "op0 code op1",
and op0 and op1 are defined by PHI nodes at e->dest,
we could still replace op0 and op1 with the PHI arguments
before we look up the condition.

With my patch, if the condition involves an SSA_NAME
that is also used as a PHI argument at e->dest,
I would guess that the lookup is very likely to fail.


-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.




[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)

2004-12-08 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2004-12-09 05:24 
---
Updated the testcase like so:

/* PR tree-optimization/18694

   The dominator optimization didn't take the PHI evaluation order
   into account when threading an edge.  */

extern void abort (void) __attribute__((noreturn));
extern void exit (int) __attribute__((noreturn));

void __attribute__((noinline))
foo (int i)
{
  int next_n = 1;
  int j = 0;

  for (; i != 0; i--)
{
  int n;

  for (n = next_n; j < n; j++)
next_n++;

  if (j != n)
abort ();
}
}

int
main (void)
{
  foo (2);
  exit (0);
}


-- 


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

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.