This is the mail archive of the gcc-patches@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: [patch] Work around gas .8byte bug.


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


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