Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bionet!ames!amdcad!weitek!dms!albaugh From: albaugh@dms.UUCP (Mike Albaugh) Newsgroups: gnu.gcc Subject: Dumb questions on GCC Keywords: define_insn, constraints Message-ID: <616@dms.UUCP> Date: 8 Feb 89 01:23:45 GMT Organization: Atari Games Inc., Milpitas, CA Lines: 51 I am trying to port gcc. Since the only system I have capable of compiling gcc is a vms vax, I am currently stuck at version 1.22 (no flames please, unless accompanied by a check sufficient to buy me a "real unix (tm)" machine). Anyway, I finally got it to compile without errors, but now it aborts if I feed it hello.c (of course that's the first program I tried :-), but not the last). The abort is _reported_ in _fixuns_truncdfsi (or something of the like) in gcclib, but appears to _really_ emanate from insn_extract() called from regclass(). Tracing back a ways, this all seems to stem from trying to figure out the "best class" of register for a given insn. Since I don't have any floating point hardware, I don't have any define_insn's for floating point. I presumed (apparently incorrectly) that gcc would notice this and use libcalls. Anyway, the whole subject of "register class" seems to key on the #define REGISTER_CONSTRAINTS which is generated by gen-config when it sees _any_ constraint whatsoever (not just register constraints). Since my machine is a load/store architecture, I can't define movesi without _some_ constraints. I'm using something like: "general_operand" "=r,m" and "general_operand" "rmI,r" and picking the right template. Note that there are no distinct flavors of register, but at least one of the operands must be _some_ register. I might be able to re-write most of my md without constraints, but some of the pre-defined ones baffle me. While I'm at it, has anyone sleuthed out a list of the required pre-defined insns. By required I mean you either don't compile or dump core if you don't have all of them. The final fix needed to get an error-free compile was to define "call_value", which is not even mentioned as being defined, let alone essential. Wierd piece of evidence - this does not happen if I compile: char *fred() { return "hello world\n"; } so it seems this path is only exercised when a subroutine call is processed. I know this is hardly an exhaustive test, but I found it interesting. Please don't think I'm just grousing. I like the structure and much of the rest of gcc. I just need a little help across the more obscure points. I apologize for the hand-waving in some of the above, but I'm telnet'd two deep to get to a machine that can post news and don't have real good access to my sources from here. Thanks in advance for any pointers. Mike | Mike Albaugh (albaugh@dms.UUCP || {...decwrl!turtlevax!}weitek!dms!albaugh) | Atari Games Corp (Arcade Games, no relation to the makers of the ST) | 675 Sycamore Dr. Milpitas, CA 95035 voice: (408)434-1709 | The opinions expressed are my own (Boy, are they ever)