1 /* { dg-do compile } */
2 /* { dg-require-effective-target int128 } */
3 /* { dg-options "-Os -fdisable-tree-evrp -fdump-tree-vrp1-details" } */
8 typedef unsigned int word
__attribute__((mode(word
)));
9 typedef unsigned __int128 bigger_than_word
;
12 foo (bigger_than_word a
, word b
, uint8_t c
)
14 /* Must fold use of t1 into use of b, as b is no wider than word_mode. */
15 const uint8_t t1
= b
% UCHAR_MAX
;
17 /* Must NOT fold use of t2 into use of a, as a is wider than word_mode. */
18 const uint8_t t2
= a
% UCHAR_MAX
;
20 /* Must fold use of t3 into use of c, as c is narrower than t3. */
21 const uint32_t t3
= (const uint32_t)(c
>> 1);
31 /* Th extra condition below is necessary to prevent a prior pass from
32 folding away the cast. Ignored in scan-tree-dump. */
39 /* { dg-final { scan-tree-dump "Folded into: if \\(_\[0-9\]+ == 1\\)" "vrp1" } } */
40 /* { dg-final { scan-tree-dump-not "Folded into: if \\(_\[0-9\]+ == 2\\)" "vrp1" } } */
41 /* { dg-final { scan-tree-dump "Folded into: if \\(_\[0-9\]+ == 3\\)" "vrp1" } } */