This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: treelang fix for rs6000 / treelang not proper front end


Zack Weinberg wrote:
Tim Josling <tej@melbpc.org.au> writes:


Treelang now works on RS6000 with this patch; the previous version had
a missing symbol in the link. Tested also on i686-pc-linux-gnu. I will
apply it shortly.

Thanks to Matthias Klose for help testing this.


Why are you linking rs6000-c.c into treelang in the first place?

zw



The treelang front end reuses some of the c front end code. That is, code which is theoretically part of the c front end but actually is used across a number of languages.


During configuration, there is front end specific code which works out which back ends have code that is specific to certain front ends. This ends up in the makefile as variables. I found this hard to believe but it is true - the fact that there is front end specific code in the config file, and that there is no orderly way to specify front end to back end dependencies other than hacking the configuration file.

Due to use of the 'c front end' code, treelang therefore needs certain files from back ends. The change required was minor but took a while because I don't have an rs6000.

Some have expressed a view that reusing code from the c front end is bad and that treelang should duplicate this code. Having actually tried this theory early on, I disagree. The amount of effort required to sustain this is an order of magnitude greater than the current regime.

As discussed on the gcc mailing list recently the interface between front end and back end is not very clean, to put it mildly. This is the real problem. Code that is not front end specific should be factored out so that it can readily be reused. Front end specific code should be in the directory for that front end, etc.

I am not sure that this is going to happen any time soon though. Even a simple proposal to move the c front end into its own directories and to move all front ends under /fe seems to be waist deep in quicksand at present.

I am not going to volunteer to fix this, as it is quite easy to do a lot of work for nothing. Even with agreement in advance about an approach to be taken, people change their minds later.

Treelang has already proven useful. Keisuke Nishida used is as a basis for his cobol front end. We should not throw all that work away because of abtract considerations such as it not being a 'proper' front end.

I already offered to people, make it a 'proper' front end i.e. duplicate all the c code. See how easy it is. Maintain it for a while. Volunteer to take over treelang maintenance.

It would be better to fix the front end back end interface IMHO rather than looking at symptoms.

Tim Josling


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]