--- Comment #13 from jakub at gcc dot gnu dot org 2008-12-16 15:05 ---
Not doing this optimization if added_clobbers_hard_reg_p would basically kill
it on i386/x86_64 except for constant values, all the shifts clobber hard
registers. But typically flags register is only live for very sh
--- Comment #12 from steven at gcc dot gnu dot org 2008-12-16 13:45 ---
Looks like something along the lines of gcse.c:can_assign_to_reg_p() is called
for here in replace_read.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37922
--- Comment #11 from jakub at gcc dot gnu dot org 2008-12-16 13:09 ---
The problem is that CSE2 extends the live range of CC register, so before DSE1
we have in _ZN11rot_mx_infoC1ERK6rot_mx function:
(insn 15 14 16 2 pr37922.C:469 (set (reg:CC 17 flags)
(compare:CC (reg/v:SI 75 [
--- Comment #10 from jakub at gcc dot gnu dot org 2008-12-16 12:48 ---
Created an attachment (id=16912)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16912&action=view)
pr37922.C
Testcase with a bunch of unneeded namespaces removed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi
--- Comment #9 from jakub at gcc dot gnu dot org 2008-12-16 12:08 ---
Indeed, -O2 -fpic returns 2, -O2 -fpic -fno-dse returns 0. The difference
between the two are just 4 successful replace_read changes, like:
movq%rdx, 224(%rsp) # D.4704, proper_r
- shrq$32, %rdx
--- Comment #8 from hjl dot tools at gmail dot com 2008-12-16 04:01 ---
Gcc 4.3 20080428 behaves the same. -m32 returns 0.
--
hjl dot tools at gmail dot com changed:
What|Removed |Added
--
--- Comment #7 from rwgk at yahoo dot com 2008-12-16 02:17 ---
(In reply to comment #6)
> Does -fno-strict-aliasing work?
>
Nope. I just tried it with svn revisions 129269 and 142737.
Adding -fno-strict-aliasing does not change the (wrong) result.
Thanks for looking at this!
--
h
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
Summary|code generation error |[4.4 Regression] code
|
--- Comment #6 from pinskia at gcc dot gnu dot org 2008-12-16 00:08 ---
Does -fno-strict-aliasing work?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37922