This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Work around gas .8byte bug.
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Sep 2004 16:37:09 -0700
- Subject: Re: [patch] Work around gas .8byte bug.
- Organization: CodeSourcery, LLC
- References: <200409220003.37089.paul@codesourcery.com>
Paul Brook wrote:
This is a followup to a problem previously discovered by Mark.
In summary gas doesn't properly handle negative integer constants larger than
the target word size. These can be generated by gcc
http://gcc.gnu.org/ml/gcc/2004-08/msg00690.html
As stated in the above mesage, the prospects of fixing gas are not good, so
I'm proposing a workaround in gcc.
The patch below changes default_assemble_integer to return false for simple
integer constants wider than the target word size. This will make gcc split
the constant into multiple word sized items.
Other code paths (eg. CONST_DOUBLE) may also use .8byte, however they output
the values as positive hex constants. Moving the splitting logic into
assemble_integer_with_op would require and extra operand passing the operand
size. It seemed better to just fall back on the existing mechanisms for
handling large constants.
In theory similar gas problems could be encountered for more complex
expressions (eg. .8byte foo + (-large_constant)). However I disbelieve that
any 32-bit target will generate these.
Ok?
OK, thanks.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com