-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-optimized" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_max (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
xc=~xc;
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_max (xc, xm, xy) != 255)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "optimized" } } */
/* { dg-final { scan-tree-dump-times "= ~" 1 "optimized" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-optimized" } */
#include <stdint.h>
+
+__attribute__ ((noipa, noinline))
uint8_t three_minmax1 (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
xc=~xc;
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_minmax1 (xc, xm, xy) != 0)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "= ~" 1 "optimized" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt" } */
#include <stdint.h>
+__attribute__ ((noinline, noipa))
uint8_t three_minmax3 (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
xc=~xc;
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_minmax3 (xc, xm, xy) != 0)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_minmax2 (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
xc=~xc;
}
return xk;
}
+
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 127;
+ volatile uint8_t xc = 0;
+ if (three_minmax2 (xc, xm, xy) != 255)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-optimized" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_minmax11 (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
xc=~xc;
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_minmax11 (xc, xm, xy) != 128)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "= ~" 1 "optimized" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt" } */
#include <stdint.h>
#include <stdbool.h>
-uint8_t three_min (uint8_t xc, uint8_t xm, uint8_t xy, bool m) {
+__attribute__ ((noinline, noipa))
+uint8_t three_min (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
if (xc)
{
return xk;
}
+
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_min (xc, xm, xy) != 0)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 3 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 0 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt -g" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_min (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
if (xc < xm) {
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_min (xc, xm, xy) != 0)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 3 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 0 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_min (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
if (xc < xm) {
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_min (xc, xm, xy) != 0)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 3 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 0 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_max (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
if (xc > xm) {
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_max (xc, xm, xy) != 255)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 0 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 3 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_minmax1 (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
if (xc > xm) {
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_minmax1 (xc, xm, xy) != 127)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_minmax3 (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
if (xc > xm) {
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_minmax3 (xc, xm, xy) != 255)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_minmax2 (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
if (xc > xm) {
}
return xk;
}
+
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_minmax2 (xc, xm, xy) != 255)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-phiopt" } */
#include <stdint.h>
+__attribute__ ((noinline, noipa))
uint8_t three_minmax11 (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
if (xc < xm) {
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_minmax11 (xc, xm, xy) != 255)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "phiopt1" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 2 "phiopt1" } } */
-/* { dg-do compile } */
+/* { dg-do run } */
/* { dg-options "-O -fdump-tree-optimized" } */
#include <stdint.h>
+__attribute__ ((noipa, noinline))
uint8_t three_min (uint8_t xc, uint8_t xm, uint8_t xy) {
uint8_t xk;
xc=~xc;
return xk;
}
+int
+main (void)
+{
+ volatile uint8_t xy = 255;
+ volatile uint8_t xm = 0;
+ volatile uint8_t xc = 127;
+ if (three_min (xc, xm, xy) != 0)
+ __builtin_abort ();
+ return 0;
+}
+
/* { dg-final { scan-tree-dump-times "= ~" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 2 "optimized" } } */
gimple_seq stmts = NULL;
tree phi_result = PHI_RESULT (phi);
result = gimple_build (&stmts, locus, minmax, TREE_TYPE (phi_result),
- arg0, bound);
+ arg0, arg1);
result = gimple_build (&stmts, locus, ass_code, TREE_TYPE (phi_result),
- result, arg1);
+ result, bound);
if (invert)
result = gimple_build (&stmts, locus, BIT_NOT_EXPR, TREE_TYPE (phi_result),
result);