egcs generates assembly lines that are too long for the DEC assembler
Hugues Talbot
Hugues.Talbot@cmis.CSIRO.AU
Tue Oct 20 21:17:00 GMT 1998
Hi there,
I've been having an annoying persitent problem with the egcs
compiler on DEC alphas, running DEC Unix (both 3.x and 4.x). The
versions of egcs I've tested are 1.0.3b and 1.1b.
Egcs was compiled *without* the --with-gnu-as compile time
option.
The problem is the following: egcs generates very very very
long assembly code lines, that the DEC assembler can't cope with, under
some circumstances.
These circumstances quickly come about when using template
code such as the STL. In the code at the end of this report,
the map<string,string> is the source of the problem. The same
code with a map <string,int> compiles without a problem.
I can "solve" this problem by using the gnu assembler, but
this creates other, just as vexing, problems because the gnu assembler
is not well supported under DEC Unix. In particular it seems
impossible to profile one's code when compiling with gnu as (This is a
problem that has been reported to the `gnu as' people).
I could live with that if there was a way to switch assembler
easily via some command line argument for example. At any rate egcs
will not presently cope with the assembler that it was not told to
spit code for at compile time.
Questions:
----------
1) Any suggestions, anyone?
2) Is there really a need for such humongous assembly
lines to be generated?
please reply also by email.
Example:
-------
The following code snipped does not compile with
egcs using the DEC assembler. It compiles fine with DEC cxx
on the same platform, as well as under Linux or Solaris with egcs
(on a PC and a sparc Ultra respectively).
========================================================
#include <map>
#include <string>
class prefs {
public:
void readprefs(void);
private:
map <string, string> prefitems;
};
void prefs::readprefs(void)
{
string keystr, stringval;
// read the whole lot by pairs, skip to the end of the line
while (cin >> keystr >> stringval) {
prefitems[keystr] = stringval;
}
return;
}
========================================================
If I compile this seemingly valid code with egcs on
alpha, I get:
% g++ -c testpref.C
as0: Warning: testpref.C, line 6: Line too long
bis $2,$2,$182t__t7rb_tree5Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt4pair2ZCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt9select1st1Zt4pair2ZCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt4less1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt24__default_alloc_template2b0i0P19__rb_tree_node_baseT1RCt4pair2ZCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0..ng
as0: Warning: testpref.C, line 6: Line too long
bis $2,$2,$182t__t7rb_tree5Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt4pair2ZCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt
etc, etc... (About 100 lines of garbage).
___Hugues Talbot, CSIRO Mathematical & Information Sciences___
/ Down under, Locked Bag 17, North Ryde NSW 2113 \
| ,-_|\ Ph: 61 2 9325 3224 Fax: 61 2 9325 3200 |
| / \ (Building E6B, Macquarie University) |
| \_,-._* <- There E-mail: hugues.talbot@cmis.csiro.au |
| , WWW: http://www.dms.csiro.au/~talbot |
+---------- Hiroshima 45, Chernobyl 86, Windows 95. -------------+
More information about the Gcc-bugs
mailing list