[gcc r13-8817] AVR: tree-optimization/115307 - Work around isinf bloat from early passes.
Georg-Johann Lay
gjl@gcc.gnu.org
Sat Jun 1 11:40:29 GMT 2024
https://gcc.gnu.org/g:c57d73f4cd5ca61327406fc2521a2235dd49d12e
commit r13-8817-gc57d73f4cd5ca61327406fc2521a2235dd49d12e
Author: Georg-Johann Lay <avr@gjlay.de>
Date: Sat Jun 1 10:38:00 2024 +0200
AVR: tree-optimization/115307 - Work around isinf bloat from early passes.
PR tree-optimization/115307
gcc/
* config/avr/avr.md (SFDF): New mode iterator.
(isinf<mode>2) [sf, df]: New expanders.
gcc/testsuite/
* gcc.target/avr/torture/pr115307-isinf.c: New test.
(cherry picked from commit fabb545026f714b7d1cbe586f4c5bbf6430bdde3)
Diff:
---
gcc/config/avr/avr.md | 16 ++++++++++++++++
.../gcc.target/avr/torture/pr115307-isinf.c | 21 +++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 866ce47d033..46f7812cea2 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -285,6 +285,8 @@
(define_mode_iterator SPLIT34 [SI SF PSI
SQ USQ SA USA])
+(define_mode_iterator SFDF [SF DF])
+
;; Define code iterators
;; Define two incarnations so that we can build the cartesian product.
(define_code_iterator any_extend [sign_extend zero_extend])
@@ -9780,6 +9782,20 @@
operands[4] = GEN_INT (bitno % 8);
})
+
+;; Work around PR115307: Early passes expand isinf/f/l to a bloat.
+;; These passes do not consider costs, and there is no way to
+;; hook in or otherwise disable the generated bloat.
+
+;; isinfsf2 isinfdf2
+(define_expand "isinf<mode>2"
+ [(parallel [(match_operand:HI 0)
+ (match_operand:SFDF 1)])]
+ ""
+ {
+ FAIL;
+ })
+
;; Fixed-point instructions
(include "avr-fixed.md")
diff --git a/gcc/testsuite/gcc.target/avr/torture/pr115307-isinf.c b/gcc/testsuite/gcc.target/avr/torture/pr115307-isinf.c
new file mode 100644
index 00000000000..6368bd205c5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/avr/torture/pr115307-isinf.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+int call_isinff (float f)
+{
+ int isinff (float);
+ return isinff (f);
+}
+
+int call_isinf (double f)
+{
+ int isinf (double);
+ return isinf (f);
+}
+
+int call_isinfl (long double f)
+{
+ int isinfl (long double);
+ return isinfl (f);
+}
+
+/* { dg-final { scan-assembler-not "unord" } } */
More information about the Gcc-cvs
mailing list