[Ada] Avoid emitting overflow check for constant result

Eric Botcazou ebotcazou@adacore.com
Fri Nov 7 09:58:00 GMT 2008


This is a follow-up to
  http://gcc.gnu.org/ml/gcc-patches/2008-07/msg02416.html
so no code generation change for the time being.

While checks would be optimized away, if the constant overflows, there would 
be no way to warn the user.  Now the constant is returned and the caller has 
to check for TREE_OVERFLOW.  This matches the behavior of build_binary_op.

Tested on i586-suse-linux, applied on the mainline.


2008-11-07  Geert Bosch  <bosch@adacore.com>

	* gcc-interface/trans.c (build_binary_op_trapv): Avoid emitting
	overflow check for constant result.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 604 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081107/6469b421/attachment.bin>


More information about the Gcc-patches mailing list