]>
Commit | Line | Data |
---|---|---|
811b72f9 EB |
1 | /* PR target/56890 */ |
2 | /* Reported by Rainer Jung <rainer.jung@kippdata.de> */ | |
3 | ||
4 | /* { dg-do assemble } */ | |
5 | /* { dg-options "-O" } */ | |
6 | ||
7 | unsigned int buggy(unsigned int min, unsigned int max) | |
8 | { | |
9 | unsigned int number; | |
10 | if (max < 16384) { | |
11 | unsigned short num16; | |
12 | num16 = min + (long) ((double) (max - min + 1.0) * (num16 / (65535 + 1.0))); | |
13 | return num16; | |
14 | } | |
15 | else { | |
16 | (number) = min + (long) ((double) (max - min + 1.0) * (number / (4294967295U + 1.0))); | |
17 | } | |
18 | return number; | |
19 | } |