Commit 5ba3ae6d by Richard Biener Committed by Richard Biener

re PR c++/66211 (Rvalue conversion in ternary operator causes internal compiler error)

2015-05-21  Richard Biener  <rguenther@suse.de>

	PR c++/66211
	* match.pd: Guard pattern optimzing (int)(float)int
	conversions to apply only on GIMPLE.

	* g++.dg/conversion/pr66211.C: New testcase.
	* gcc.dg/tree-ssa/forwprop-18.c: Adjust.

From-SVN: r223483
parent 1ca46a77
2015-05-21 Richard Biener <rguenther@suse.de>
PR c++/66211
* match.pd: Guard pattern optimzing (int)(float)int
conversions to apply only on GIMPLE.
2015-05-21 Jeff Law <law@redhat.com>
* combine.c (find_split_point): Handle ASHIFT like MULT to encourage
......
......@@ -791,7 +791,8 @@ along with GCC; see the file COPYING3. If not see
/* If we are converting an integer to a floating-point that can
represent it exactly and back to an integer, we can skip the
floating-point conversion. */
(if (inside_int && inter_float && final_int &&
(if (GIMPLE /* PR66211 */
&& inside_int && inter_float && final_int &&
(unsigned) significand_size (TYPE_MODE (inter_type))
>= inside_prec - !inside_unsignedp)
(convert @0))))))
......
2015-05-21 Richard Biener <rguenther@suse.de>
PR c++/66211
* g++.dg/conversion/pr66211.C: New testcase.
* gcc.dg/tree-ssa/forwprop-18.c: Adjust.
2015-05-21 Jeff Law <law@redhat.com>
* gcc.target/hppa/shadd-2.c: New test.
......
// PR c++/66211
// { dg-do compile }
void f(int&){}
int main()
{
int x = 0;
double y = 1;
f(1 > 0 ? x : y); // { dg-error "from an rvalue" }
}
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-forwprop1" } */
/* { dg-options "-O -fdump-tree-cddce1" } */
signed char f1(signed char n)
{
......@@ -19,6 +19,6 @@ signed char g2(unsigned long long n)
return (float)n;
}
/* { dg-final { scan-tree-dump-times "\\\(float\\\)" 2 "forwprop1" } } */
/* { dg-final { scan-tree-dump-not "\\\(long double\\\)" "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "\\\(float\\\)" 2 "cddce1" } } */
/* { dg-final { scan-tree-dump-not "\\\(long double\\\)" "cddce1" } } */
/* { dg-final { cleanup-tree-dump "cddce1" } } */
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