Commit 18b0ea8f by Michael Matz Committed by Michael Matz

re PR middle-end/55771 (Negation and type conversion incorrectly exchanged)

	PR middle-end/55771
	* convert.c (convert_to_real): Reject non-float inner types.

testsuite/
	* c-c++-common/pr55771.c: New test.

From-SVN: r200926
parent e4f0f84d
2013-07-12 Michael Matz <matz@suse.de>
PR middle-end/55771
* convert.c (convert_to_real): Reject non-float inner types.
2013-07-12 Tejas Belagod <tejas.belagod@arm.com>
* config/aarch64/aarch64-protos.h
......
......@@ -213,11 +213,12 @@ convert_to_real (tree type, tree expr)
switch (TREE_CODE (expr))
{
/* Convert (float)-x into -(float)x. This is safe for
round-to-nearest rounding mode. */
round-to-nearest rounding mode when the inner type is float. */
case ABS_EXPR:
case NEGATE_EXPR:
if (!flag_rounding_math
&& TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (expr)))
&& FLOAT_TYPE_P (itype)
&& TYPE_PRECISION (type) < TYPE_PRECISION (itype))
return build1 (TREE_CODE (expr), type,
fold (convert_to_real (type,
TREE_OPERAND (expr, 0))));
......
2013-07-12 Michael Matz <matz@suse.de>
PR middle-end/55771
* c-c++-common/pr55771.c: New test.
2013-07-12 Tejas Belagod <tejas.belagod@arm.com>
* gcc.target/aarch64/vect-movi.c: New.
......
/* { dg-do run } */
float global;
int main()
{
unsigned long z = 1;
float x = -z;
global = x;
if (global < 0)
__builtin_abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment