*** MOVED ***

NOTE: I have merged the contents of this blog with my web-site. I will not be updating this blog any more.


GCJ Front End Hacking

A couple of remarkable things happened while I was working on the above. First, my wife got curious about what I was trying to fix and how I planned to fix it and pretty soon I found myself walking my wife through the parsing bits of the GCJ front end, including the Java grammar!

She and my sister then left for a movie that I was not at all keen to watch, so I spent that time at home hacking on GCJ - that resulted in four and half hours of continuous hacking that was masochistically exhilarating, helped of course by the fact that I was actually able to find a satisfactory solution at the end of it.

Such hacking binges are sadly so rare now, but used to be so frequent during my undergraduate days. ~sigh~ :-(
Anyway, I found out that the GCJ front-end is not such a mess after all - there's a method to the madness, as they say, but it requires a bit of patience and perseverance to understand. Of course, to use another cliche, I have just seen the tip of the iceberg - who knows what horrors lurk as I try to delve deeper into the front end?

Anyone wishing to understand the front end should definitely try out Alexandre Oliva's debugx to step through the code using a debugger like GDB to see how it works. Inside a debugger, GCC's cool debug_tree() function can be used to examine a TREE node. The GNU coding standards make it very easy to search for the implementation of a function in a file (ESC/^foobar in vi, for example). The function java_parse_file() in the file "java/jcf-parse.c" provides the "big picture" for the front end.

(Originally posted on Advogato.)

Package-Private Class Access in GCJ

This weekend I thought I would try my luck at nailing down another instance of illegal package-private access that GCJ lets through (PR java/15073). As luck would have it, I was able to come up with a patch that fixes that problem. The great thing about this patch is that it also simplifies my fix to the other package-private access problem, by removing a nagging kludge that was needed for that fix to work properly. (If you must know, not_accessible_p() in "java/parse.y" was being called even for classes and not just members as it was supposed to be - the kludge was needed to account for such rogue TYPE_DECLs.) Cool!

(Originally posted on Advogato.)


CVS Updates Over SSH

The slow CVS updates from the GCC repository that I was facing were mostly due to filesystem corruption on the machine hosting gcc.gnu.org and sources.redhat.com. Now that these problems have been fixed, my CVS updates over SSH are acceptably fast over my dial-up link at home.

(Originally posted on Advogato.)

GCC 3.4.0 Released

GCC 3.4.0 is out with tonnes of improvements! Notable among these are cool optimiser improvements (profile feedback based optimisation and unit-at-a-time compilation), a rewritten C++ parser that brings g++ much closer to standards conformance, much better GCJ and a Java interpreter that can actually run Eclipse 2.x(!), etc.

(Originally posted on Advogato.)

Illegal Package-Private Accesses Checking

...in the current GCJ is just plain broken. I have had a simple patch for fixing this for accesses to package-private members for a long
time now, but the bug had let in a few instances of wrong code to creep into libgcj that were sometimes trivial, sometimes not so trivial, to fix. Yesterday, Michael Koch committed the fix for the last of these problems and therefore I promptly submitted a revised version of my patch for review.

Unfortunately, this still does not fix illegal access to package-private classes though.

Sadder still is that GCJ still has a bunch of problems related to access control. :-(

(Originally posted on Advogato.)


Awed by GRUB/Linux

I had heard of the "loop" capabilities of mount and the Linux kernel, but I experienced its full utility only yesterday - very, very cool!

We needed to install SuSE Linux apart from the existing Red Hat installation on our machine at the office, but neither was the floppy drive enabled nor was it possible to get a bootable CD burned from the corresponding ISO image from SuSE due to the existing "IT policies". (Yes, big corporations are like this some times.)

So we first reformatted our swap partition as a regular ext3 filesystem, "loop" mounted the ISO image and copied over all the files into the newly created filesystem. Then we used the cool edit-boot-parameters-before-booting feature of GRUB to temporarily boot using this filesystem and proceeded to the actual installation. No floppy or CD required!

SuSE Linux 9.0 has a lot more eye candy than a default installation of Red Hat Enterprise Linux 9.0 and also has a couple of cool extra features. I look forward to exploring this variant of my favourite OS.

But I still love Slackware and yearn for its simple methods.

(Originally posted on Advogato.)

NV40 a.k.a. NVIDIA GeForce6


(Originally posted on Advogato.)

TrueType Fonts Under FreeType2

If you are in a country where software patents do not (yet) apply - or if you just do not believe in them - you should always compile FreeType2 with TT_CONFIG_OPTION_BYTECODE_INTERPRETER defined in the file "include/freetype/config/ftoption.h". This improves the display of TrueType fonts. However, "Times New Roman" and "Courier New" still do not render nicely enough under Mozilla for me. :-(
(Yes, I do have the Xft/Gtk2/Pango enabled build of Mozilla.)

(Originally posted on Advogato.)



Please do not say or write "Mr Foo Bar" on first mention - just say "Foo Bar" the first time you refer to a person - after that, you can call him "Mr Bar".
The Economist's Style Guide spells it out nicely. In fact, the "Mr Foo Bar" form is not proper at all, but is sadly used almost universally by (at least) English speaking Indians - just use the surnames with "Mr/Mrs/Miss" as in "Mr Bar".

This is not to say that I speak/write perfect English (I
strive to, but mostly fail), but there are some things that irritate me more than others and this is one of them.

(Originally posted on Advogato.)

Garbage Collection

Tom quotes Stephan T. Lavavej:"Garbage collection is a morally bankrupt idea".

In my opinion, most developers seem to naively think that Garbage Collection is bad and expensive. They assert that nothing can beat malloc( )/free( ) based explicit (or implicit, via destructors invoked on leaving a scope) resource management. In fact, unless it is a good implementation of malloc( )/free( ), how can you even be sure that these functions will return in a "reasonable" amount of time, every time? You can have sudden stalls under heavy conditions even with these, just as with a garbage collector.

Many nice articles and eye-openers on Garbage Collection can be found at Hans Boehm's site. This article is particularly relevant.

(Originally posted on Advogato.)

CVS over SSH

Sean Middleditch points out that I should ask SSH to compress the transmitted data by using the "-C" flag. The SSH manual says that I can also set the variables "Compression" and "CompressionLevel" to achieve the same effect. Thanks a lot Sean!

(Originally posted on Advogato.)



Baby's first GCC CVS commit.

"cvs update" over SSH is so slow! Why? Is there anything I can do to help matters?

(Originally posted on Advogato.)

GDB 6.1

GDB 6.1 has
finally been released. This is the only version that works
properly with the current GCC CVS without crashing out on the DWARF-2 location lists generated by GCC (that can be disabled by using "-fno-var-tracking").

(Originally posted on Advogato.)



In one of those now rare moods that used to be so common when I was new to Linux, I spent most of my week simply updating almost every package on my system to the latest stable release by compiling from source, including glibc! Much of it was a breeze (yes, even glibc), but Qt and KDE gave me the most grief - for some reason, uic from Qt simply omits the KDE headers required to access custom KDE widgets from KDE applications, causing the builds to irritatingly break every now and then. I think it is the fault of the ".ui" files in the KDE distribution, but wouldn't they have built and tested the distribution before release? I am confused, but I haven't found any answers via Google yet. >:-(
GCC keeps regressing in compile speed, especially for C++ code, with the result that Qt/KDE took an enormous amount of time to build with GCC 3.3.3 - I felt like going with Gtk+/GNOME just for this reason! But for some strange, possibly idiotic, reason, I persisted and the result is I must say quite pretty - KDE 3.2.1 feels much faster and is so gorgeous to look at! (For some reason, my display wallpaper change does not take effect at all, though Konqueror is able to display all these wallpapers just fine - does anyone have an idea why?)

An awesome side-effect is that everything is now rendered in TrueType fonts, albeit with so much weird anti-aliasing that it becomes difficult to read text for long. (A few years ago, I wouldn't have believed that this is going to be my primary complaint with my Linux desktop. :-) Who says we haven't made progress here?)

(Originally posted on Advogato.)


Since there is no way my hopelessly unreliable dial-up link at home is going to let me synchronise with the GCC CVS repository (which is around 234MB of checked out files), I checked it out elsewhere(?), archived it and brought it home - from that point, checking out differential updates became possible even on my otherwise useless link. Now I finally have a CVS checkout of GCC that can be kept as updated as I wish.

What took me so long to implement this was the time taken to figure out a way of using TCP/IP over HTTP behind a proxy server so that CVS could be used, a way of carrying large amounts of data back home and the time taken to move my glutius maximus.

So I applied for, and got, write access to the GCC CVS this week, albeit not without problems (why do I always run into such things?).

(Originally posted on Advogato.)

Hear Ye, Hear Ye!

Planet Classpath has started collecting entries from my diary!

(Originally posted on Advogato.)