This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/16559] Incorrect code generated for function pointer
- From: "wilson at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2004 00:26:22 -0000
- Subject: [Bug target/16559] Incorrect code generated for function pointer
- References: <20040715070433.16559.hjl@lucon.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From wilson at gcc dot gnu dot org 2004-07-16 00:26 -------
This is only partly fixed in gcc-3.4/mainline. If you use an offset larger than
the 14-bit immediate field, then it still fails. You can see this if you add a
field to the structure
unsigned int array[2048];
and then look at the resulting assembly. However, I think we can ignore this
indefinitely, as the function descriptors are only 16-bytes long, and hence we
don't need such large offsets to work.
The patch that fixed it on mainline is the second patch in
http://gcc.gnu.org/ml/gcc-patches/2003-05/msg01325.html
Unfortunately, this depends on other patches, and fixes other problems, so we
probably don't want to bring the whole thing in. We really only need one line
of it though.
The underlying problem here is that ia64_expand_load_address knows that certain
kinds of SYMBOL_REFs have to be treated specially, but it gives no special
treatment to a SYMBOL_REF that is inside a CONST. The above patch fixes this by
replacing a call to gen_load_symptr with a recursive call. This only partly
solves the problem though, because if hi != 0, then we have another CONST, and
the special bits on the SYMBOL_REF get ignored again. This is good enough to
make this testcase work though.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |wilson at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-07-16 00:26:21
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16559