Re: profiledbootstrap fails in java with "error: verification failed at PC=8: branch out of range"

2010-11-26 Thread Andrew Haley
On 11/25/2010 11:25 PM, Uros Bizjak wrote:

> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:
> In class 'gnu.java.awt.peer.gtk.GtkComponentPeer':
> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:
> In method 
> 'gnu.java.awt.peer.gtk.GtkComponentPeer.handleEvent(java.awt.AWTEvent)':
> In file included from :63:0:
> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:279:0:
> error: verification failed at PC=8: branch out of range
> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:279:0:
> internal compiler error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See  for instructions.
> gmake[5]: *** [gnu-java-awt-peer-gtk.lo] Error 1
> 
> Any info what this verification error means?

Either

a.  A file (GtkComponentPeer.class) has been corrupted

or

b.  verify-* in gcc/java has been miscompiled by gcc.

or

c.  something used by verify-* in gcc/java has changed, and now
verify-* is broken.

Andrew.


Re: RFD: hookizing BITS_PER_UNIT in tree optimizers / frontends

2010-11-26 Thread Paul Koning

On Nov 24, 2010, at 9:37 PM, Dave Korn wrote:

> On 24/11/2010 21:31, Joern Rennecke wrote:
>> ...
>> We can add the generator program when we (re-) add a word addressed
>> target, or add a bit addressed one.
> 
>  I do think that this goal is not so far off that we should actually
> encourage new code to break it.  I built gcc 4.5.0 based on a 24-bit word size
> recently, just in order to get the driver to work and the actual compiler
> itself to successfully init itself and compile an empty file without crashing,
> and that proved entirely practical, so we might not be so far off as one might
> assume.  That shows that the core is already substantially independent from
> the target, I think, and that we could go further with that independence.

How much interest is there in having this sort of thing work?  Indeed we had 
32-bit unit targets in the recent past, but no more.  Non 8 bit per unit is 
longer ago, probably; the pdp10 port is an example but that's way back on 2.95.

Just to play around I'm trying to see if gcc will compile for a 60 bit target 
with 6 bit units.  The answer is that it will not as it stands, though the 
changes necessary to make it do basic things like "a=b;" are actually quite 
small.

paul



Re: RFD: hookizing BITS_PER_UNIT in tree optimizers / frontends

2010-11-26 Thread Richard Henderson
On 11/23/2010 12:09 PM, Joern Rennecke wrote:
> If we changed BITS_PER_UNIT into an ordinary piece-of-data 'hook', this
> would not only cost a data load from the target vector, but would also
> inhibit optimizations that replace division / modulo / multiply with shift
> or mask operations.
> So maybe we should look into having a few functional hooks that do common 
> operations, i.e.
> bits_in_unitsx / BITS_PER_UNIT
> bits_in_units_ceil   (x + BITS_PER_UNIT - 1) / BITS_PER_UNIT
> bit_unit_remainder   x % BITS_PER_UNIT
> units_in_bitsx * BITS_PER_UNIT

I think actual hooks is perhaps more overhead than plain division.
At least on an x86 host, which is 99% of all running hosts.

We might be able to do better with log2_bits_per_unit as data, and
a compatibility define

#define BITS_PER_UNIT (1 << targetm.log2_bits_per_unit)

which ought to give the compiler the info it needs to optimize
the operations above into shifts.


r~


re: extern "C" applied liberally?

2010-11-26 Thread Jay K

I somewhat tracked down the odd/dubious reason extern "C" is "good".


Some wierd interaction on Darwin with Apple's gcc and gdb.

Breakpoints don't work on non-extern "C", at least if a library is involved.

This isn't necessarily a problem with gcc, or current gcc, or non-Apple gcc,
or gdb, or non-Apple gdb, but somewhere in the Apple gcc/gdb.
Reported here for followup to my suggestion of liberal use of extern "C".
  (which I have applied to our fork and it does help)


1.c

#include "1.h"

int main()
{
 F1();
}


2.c

#ifdef EXTERNC
extern "C" {
#endif
static void F2(void) { }
void F1(void) { F2(); }
#ifdef EXTERNC
}
#endif


1.h
#ifdef EXTERNC
extern "C" {
#endif
void F1(void);
#ifdef EXTERNC
}
#endif


$ rm -rf a.out*
$ g++ -g -c 1.c 2.c
$ rm lib2.a
$ ar rc lib2.a 2.o
$ rm 2.o
$ g++ -g 1.o -L. -l2
$ gdb ./a.out
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
...
(gdb) break F2
Function "F2" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) break F1
Function "F1" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) q


$ g++ -g -c 1.c 2.c -DEXTERNC
$ rm 2.o
$ rm lib2.a
$ g++ -g -c 1.c 2.c -DEXTERNC
$ ar rc lib2.a 2.o
$ g++ -g 1.o -L. -l2
$ gdb ./a.out
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
...

(gdb) break F2
Breakpoint 1 at 0x1fae: file 2.c, line 4.
(gdb) break F1
Breakpoint 2 at 0x1fb6: file 2.c, line 5.
(gdb) q


Using Apple's gcc-4.2 didn't help.


Strange.


(In reality, the library is libbackend.a)


$ g++ -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5493~1/src/configure --disable-checking 
-enable-werror --prefix=/usr --mandir=/share/man 
--enable-languages=c,objc,c++,obj-c++ 
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ 
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib 
--build=i686-apple-darwin9 --with-arch=apple --with-tune=generic 
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5493)


I could try with my own gcc.
But maybe it is a matter of flags to gcc/ar/ld.


 - Jay
  


Re: profiledbootstrap fails in java with "error: verification failed at PC=8: branch out of range"

2010-11-26 Thread Uros Bizjak
Hello!

>> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:
>> In class 'gnu.java.awt.peer.gtk.GtkComponentPeer':
>> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:
>> In method 
>> 'gnu.java.awt.peer.gtk.GtkComponentPeer.handleEvent(java.awt.AWTEvent)':
>> In file included from :63:0:
>> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:279:0:
>> error: verification failed at PC=8: branch out of range
>> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:279:0:
>> internal compiler error: Segmentation fault
>> Please submit a full bug report,
>> with preprocessed source if appropriate.
>> See  for instructions.
>> gmake[5]: *** [gnu-java-awt-peer-gtk.lo] Error 1
>>
>> Any info what this verification error means?
>
> Either
>
> a.  A file (GtkComponentPeer.class) has been corrupted
>
> or
>
> b.  verify-* in gcc/java has been miscompiled by gcc.
>
> or
>
> c.  something used by verify-* in gcc/java has changed, and now
> verify-* is broken.

Right on spot, It is verify_instructions_0 from verify-impl.c that is
miscompiled. Following patch avoids these failures and enables
profiledbootstrap to finish:

Index: gcc/java/verify-impl.c
===
--- gcc/java/verify-impl.c  (revision 167188)
+++ gcc/java/verify-impl.c  (working copy)
@@ -2211,6 +2211,7 @@ initialize_stack (void)
 }

 static void
+__attribute__((__optimize__(1)))
 verify_instructions_0 (void)
 {
   int i;

Uros.


Re: profiledbootstrap fails in java with "error: verification failed at PC=8: branch out of range"

2010-11-26 Thread Richard Guenther
On Sat, Nov 27, 2010 at 12:12 AM, Uros Bizjak  wrote:
> Hello!
>
>>> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:
>>> In class 'gnu.java.awt.peer.gtk.GtkComponentPeer':
>>> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:
>>> In method 
>>> 'gnu.java.awt.peer.gtk.GtkComponentPeer.handleEvent(java.awt.AWTEvent)':
>>> In file included from :63:0:
>>> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:279:0:
>>> error: verification failed at PC=8: branch out of range
>>> /home/uros/gcc-svn/trunk/libjava/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java:279:0:
>>> internal compiler error: Segmentation fault
>>> Please submit a full bug report,
>>> with preprocessed source if appropriate.
>>> See  for instructions.
>>> gmake[5]: *** [gnu-java-awt-peer-gtk.lo] Error 1
>>>
>>> Any info what this verification error means?
>>
>> Either
>>
>> a.  A file (GtkComponentPeer.class) has been corrupted
>>
>> or
>>
>> b.  verify-* in gcc/java has been miscompiled by gcc.
>>
>> or
>>
>> c.  something used by verify-* in gcc/java has changed, and now
>>     verify-* is broken.
>
> Right on spot, It is verify_instructions_0 from verify-impl.c that is
> miscompiled. Following patch avoids these failures and enables
> profiledbootstrap to finish:

I'd try without value-profile transformations first.

Richard.

> Index: gcc/java/verify-impl.c
> ===
> --- gcc/java/verify-impl.c      (revision 167188)
> +++ gcc/java/verify-impl.c      (working copy)
> @@ -2211,6 +2211,7 @@ initialize_stack (void)
>  }
>
>  static void
> +__attribute__((__optimize__(1)))
>  verify_instructions_0 (void)
>  {
>   int i;
>
> Uros.
>


Miss head file diagnostic.h in plugin.h?

2010-11-26 Thread Mingjie Xing
Hi,

When I try to build my plugin, I get such errors,

In file included from ../../gcc-vcg-plugin/vcg-plugin/gcc-function.c:27:0:
/home/eric/install/trunk/lib/gcc/i686-pc-linux-gnu/4.6.0/plugin/include/plugin.h:35:65:
error: expected ‘)’ before ‘*’ token
In file included from ../../gcc-vcg-plugin/vcg-plugin/vcg-plugin.h:27:0,
 from ../../gcc-vcg-plugin/vcg-plugin/gcc-function.c:30:
/home/eric/install/trunk/lib/gcc/i686-pc-linux-gnu/4.6.0/plugin/include/gimple.h:31:26:
fatal error: hard-reg-set.h: No such file or directory
compilation terminated.

The first error occurs due to that using diagnostic_context in the
plugin.h without including diagnostic.h. The second error is about
missing hard-reg-set.h.

GCC trunk revision: 167194

Thanks,
Mingjie


[wwwdocs] PATCH for Re: new mirror in Tampa, US

2010-11-26 Thread Gerald Pfeifer
On Fri, 19 Nov 2010, Peter Vrzak wrote:
> We have launched a new GCC mirror server offering HTTP access.
> http://mirrors-us.seosue.com/gcc/
> 
> The server is located in Tampa, FL, United States.

Thanks, Peter.  I announced the mirror per the below.

> The update is scheduled twice a week.

Is there any particular reason you do not do this daily?  It's not
an absolute must, but We kind of prefer that, and using rsync it
should not make a real difference in terms of overall bandwidth.

Gerald

Index: mirrors.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/mirrors.html,v
retrieving revision 1.203
diff -u -3 -p -r1.203 mirrors.html
--- mirrors.html17 Oct 2010 16:36:36 -  1.203
+++ mirrors.html27 Nov 2010 07:51:51 -
@@ -53,6 +53,7 @@ Key fingerprint = 33C2 35A3 4C46 AA3F FB
 UK: ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/";>ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/,
 thanks to mirror at mirrorservice dot org
 UK, London: http://gcc-uk.internet.bs";>http://gcc-uk.internet.bs, thanks to 
Internet.bs (info at internet dot bs)
 US, Chicago: http://mirrorpool.in/Gcc/";>http://mirrorpool.in/Gcc/, thanks to 
Slevin Black (topoyr at gmail dot com)
+US, Tampa: http://mirrors-us.seosue.com/gcc/";>http://mirrors-us.seosue.com/gcc/, 
thanks to Peter Vrzak (petervrzak at gmail dot com)
 Viet Nam, HoChiMinh: http://mirror-fpt-telecom.fpt.net/gcc/";>http://mirror-fpt-telecom.fpt.net/gcc/,
 thanks to Minh Vu Tong (mirror at fpt dot net)