public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "senthil_kumar.selvaraj at atmel dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/64331] New: regcprop propagates registers noted as REG_DEAD Date: Tue, 16 Dec 2014 13:07:00 -0000 [thread overview] Message-ID: <bug-64331-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64331 Bug ID: 64331 Summary: regcprop propagates registers noted as REG_DEAD Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: senthil_kumar.selvaraj at atmel dot com Created attachment 34290 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34290&action=edit Source file For the AVR target, compiling the attached source file with -O1 results in code like this <snip> or r20,r21 or r20,r22 or r20,r23 breq .L1 ldd r24,Z+4 ldd r25,Z+5 ldd r26,Z+6 ldd r27,Z+7 cp r20,r24 cpc r21,r25 cpc r22,r26 cpc r23,r27 </snip> Register R20 was clobbered first up, but is used to compare against R24. fdump-rtl-all-raw showed that cprop_hardreg is the culprit. In pass *.ce3 <snip> (insn 7 4 8 2 (set (reg:SI 16 r16 [orig:43 D.1617 ] [43]) (reg/v:SI 20 r20 [orig:46 x ] [46])) reduced.c:12 94 {*movsi} (nil)) ... (insn 13 12 14 3 (parallel [ (set (cc0) (compare (reg/v:SI 20 r20 [orig:46 x ] [46]) (const_int 0 [0]))) (clobber (scratch:QI)) ]) reduced.c:17 413 {*cmpsi} (expr_list:REG_DEAD (reg/v:SI 20 r20 [orig:46 x ] [46]) (nil))) ... (insn 17 16 18 4 (parallel [ (set (cc0) (compare (reg:SI 16 r16 [orig:43 D.1617 ] [43]) (reg:SI 24 r24 [orig:48 t_3(D)->b ] [48]))) (clobber (scratch:QI)) ]) reduced.c:20 413 {*cmpsi} (expr_list:REG_DEAD (reg:SI 24 r24 [orig:48 t_3(D)->b ] [48]) (expr_list:REG_DEAD (reg:SI 16 r16 [orig:43 D.1617 ] [43]) (nil)))) </snip> into <snip> ;; Function foo (foo, funcdef_no=0, decl_uid=1599, cgraph_uid=0, symbol_order=0) insn 17: replaced reg 16 with 20 rescanning insn with uid = 17. .. (insn 17 16 18 4 (parallel [ (set (cc0) (compare (reg:SI 20 r20 [orig:43 D.1617 ] [43]) (reg:SI 24 r24 [orig:48 t_3(D)->b ] [48]))) (clobber (scratch:QI)) ]) reduced.c:20 413 {*cmpsi} (expr_list:REG_DEAD (reg:SI 24 r24 [orig:48 t_3(D)->b ] [48]) (expr_list:REG_DEAD (reg:SI 16 r16 [orig:43 D.1617 ] [43]) (nil)))) </snip> The AVR backend, on seeing that reg:SI r20 is dead in insn 13, emits code that clobbers r20, and this breaks the read in insn 17.
next reply other threads:[~2014-12-16 13:07 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-12-16 13:07 senthil_kumar.selvaraj at atmel dot com [this message] 2014-12-16 13:08 ` [Bug rtl-optimization/64331] " senthil_kumar.selvaraj at atmel dot com 2014-12-16 14:31 ` [Bug target/64331] " rguenth at gcc dot gnu.org 2014-12-16 16:24 ` ebotcazou at gcc dot gnu.org 2014-12-17 2:34 ` senthil_kumar.selvaraj at atmel dot com 2014-12-17 15:12 ` ebotcazou at gcc dot gnu.org 2015-02-20 17:11 ` gjl at gcc dot gnu.org 2015-03-03 11:10 ` gjl at gcc dot gnu.org 2015-03-03 11:25 ` gjl at gcc dot gnu.org 2015-03-03 11:36 ` gjl at gcc dot gnu.org 2015-04-22 12:01 ` jakub at gcc dot gnu.org 2015-07-16 9:18 ` rguenth at gcc dot gnu.org 2015-09-28 16:27 ` olegendo at gcc dot gnu.org 2022-01-09 0:43 ` pinskia at gcc dot gnu.org 2023-05-28 17:02 ` gjl at gcc dot gnu.org 2023-05-28 17:02 ` gjl at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-64331-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).