+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
/* 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.
--- /dev/null
+// 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)
{
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" } } */