diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-03 08:08:45 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-03 08:08:45 +0000 |
commit | 2def4626263b89400488ee0b0c80aa37ccb11da1 (patch) | |
tree | fcfb8ad6695559d7afcf07bbdca29d1831713173 /gcc | |
parent | 87c764583df24a4b36bd98e50ab4fc68a51794e6 (diff) | |
download | gcc-2def4626263b89400488ee0b0c80aa37ccb11da1.tar.gz |
PR middle-end/21282
* convert.c (convert_to_integer): Convert ceil and floor in
c99 mode only.
testsuite:
PR middle-end/21282
* gcc.dg/pr21282.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99144 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/convert.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr21282.c | 9 |
4 files changed, 22 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b781ed82af5..7cd6c72b318 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-05-03 Uros Bizjak <uros@kss-loka.si> + + PR middle-end/21282 + * convert.c (convert_to_integer): Convert ceil and floor in + c99 mode only. + 2005-04-29 Geoffrey Keating <geoffk@apple.com> PR target/20813 diff --git a/gcc/convert.c b/gcc/convert.c index c6c2620ab11..97705a2926a 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -349,26 +349,20 @@ convert_to_integer (tree type, tree expr) switch (fcode) { - case BUILT_IN_CEILF: - case BUILT_IN_CEILL: + case BUILT_IN_CEIL: case BUILT_IN_CEILF: case BUILT_IN_CEILL: /* Only convert in ISO C99 mode. */ if (!TARGET_C99_FUNCTIONS) break; - /* ... Fall through ... */ - case BUILT_IN_CEIL: if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (long_long_integer_type_node)) fn = mathfn_built_in (s_intype, BUILT_IN_LLCEIL); else fn = mathfn_built_in (s_intype, BUILT_IN_LCEIL); break; - case BUILT_IN_FLOORF: - case BUILT_IN_FLOORL: + case BUILT_IN_FLOOR: case BUILT_IN_FLOORF: case BUILT_IN_FLOORL: /* Only convert in ISO C99 mode. */ if (!TARGET_C99_FUNCTIONS) break; - /* ... Fall through ... */ - case BUILT_IN_FLOOR: if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (long_long_integer_type_node)) fn = mathfn_built_in (s_intype, BUILT_IN_LLFLOOR); else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e8ebb36fb94..ede71cb4e1b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-05-03 Uros Bizjak <uros@kss-loka.si> + + PR middle-end/21282 + * gcc.dg/pr21282.c: New. + 2005-05-03 David Billinghurst <David.Billinghurst@riotinto.com> * gcc.dg/vect/pr20122.c: Clean up .vect file. diff --git a/gcc/testsuite/gcc.dg/pr21282.c b/gcc/testsuite/gcc.dg/pr21282.c new file mode 100644 index 00000000000..427e3938501 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr21282.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O1" } */ + +extern double floor (double); + +long foo (float f) +{ + return (long) floor (f); +} |