This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Committed] PR28473: wrong code folding (unsigned long long)round()


Hello Roger!

The following patch has been tested on i686-pc-linux-gnu with a
full "make bootstrap", all default languages including Ada, and
regression tested with a top-level "make -k check" with no new
failures.

Committed to mainline as revision 115742.  I'll backport this to
the release branches after a few days without problems.  My apologies
and gratitude again to Richard; I didn't realise he was investigating
a solution when Andrew Pinski asked that I look into this PR.



2006-07-25 Roger Sayle <roger@eyesopen.com>

	PR middle-end/28473
	* convert.c (convert_to_integer): When transforming (T)foo(x) into
	bar(x) check that bar's result type can represent all the values of T.

* gcc.dg/fold-convround-1.c: New test case.


Your patch introduces a regression on x86_64:

Running target unix
FAIL: gcc.dg/torture/builtin-convert-2.c -O1 (test for excess errors)
FAIL: gcc.dg/torture/builtin-convert-2.c -O2 (test for excess errors)
FAIL: gcc.dg/torture/builtin-convert-2.c -O3 -fomit-frame-pointer (test for excess errors)
FAIL: gcc.dg/torture/builtin-convert-2.c -O3 -g (test for excess errors)
FAIL: gcc.dg/torture/builtin-convert-2.c -Os (test for excess errors)


The errors are:

/tmp/ccbJSyuK.o(.text+0x39): In function `foo':
builtin-convert-2.c: undefined reference to `lround'
/tmp/ccbJSyuK.o(.text+0x49):builtin-convert-2.c: undefined reference to `llround'
/tmp/ccbJSyuK.o(.text+0x58):builtin-convert-2.c: undefined reference to `link_error_round_llround'
/tmp/ccbJSyuK.o(.text+0x63):builtin-convert-2.c: undefined reference to `lroundf'
/tmp/ccbJSyuK.o(.text+0x71):builtin-convert-2.c: undefined reference to `llroundf'
...etc...


It looks that the conversion is now effectively disabled on 64bit targets...

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]