public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] tree-optimization/109724 - new testcase
@ 2023-05-04  7:43 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-05-04  7:43 UTC (permalink / raw)
  To: gcc-patches

The following adds a testcase for PR109724 which was caused by
backporting r13-2375-gbe1b42de9c151d and fixed by r11-199-g2b42509f8b7bdf.

Tested on x86_64-unknown-linux-gnu, pushed.

	PR tree-optimization/109724
	* g++.dg/torture/pr109724.C: New testcase.
---
 gcc/testsuite/g++.dg/torture/pr109724.C | 32 +++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/torture/pr109724.C

diff --git a/gcc/testsuite/g++.dg/torture/pr109724.C b/gcc/testsuite/g++.dg/torture/pr109724.C
new file mode 100644
index 00000000000..4a88e1519d0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr109724.C
@@ -0,0 +1,32 @@
+// { dg-do compile }
+
+double &SkTMax(double &a, double &b) { return a ?: b; }
+struct SkDPoint {
+  double fX;
+};
+struct SkDCubic {
+  SkDPoint &operator[](int n) { return fPts[n]; }
+  SkDPoint fPts[4];
+};
+struct SkDCurve {
+  SkDCubic fCubic;
+  SkDPoint &operator[](int n) { return fCubic[n]; }
+};
+struct SkDCurveSweep {
+  SkDCurve fCurve;
+};
+int endsIntersect_rPts;
+double endsIntersect_maxX;
+struct SkOpAngle {
+  void endsIntersect();
+  SkDCurveSweep fPart;
+} endsIntersect_rh;
+void SkOpAngle::endsIntersect() {
+  for (int index = 0;; ++index) {
+    SkDCurve &curve = index ? endsIntersect_rh.fPart.fCurve : fPart.fCurve;
+    for (int idx2 = 0; endsIntersect_rPts; ++idx2) {
+      SkDPoint &__trans_tmp_1 = curve[idx2];
+      endsIntersect_maxX = SkTMax(endsIntersect_maxX, __trans_tmp_1.fX);
+    }
+  }
+}
-- 
2.35.3

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-04  7:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04  7:43 [PATCH] tree-optimization/109724 - new testcase Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).