public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/66087] New: Invalid narrowing of MEM with containing POST_INC
@ 2015-05-09 11:35 schwab@linux-m68k.org
  2015-05-09 15:30 ` [Bug rtl-optimization/66087] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: schwab@linux-m68k.org @ 2015-05-09 11:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66087

            Bug ID: 66087
           Summary: Invalid narrowing of MEM with containing POST_INC
           Product: gcc
           Version: 4.8.5
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: schwab@linux-m68k.org
                CC: law at redhat dot com
  Target Milestone: ---
            Target: m68k-*-*

Created attachment 35511
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35511&action=edit
Testcase extracted from icu

With the attached test case compiled with -O2, reload is transforming

(insn 21 20 22 4 (set (reg:SI 47 [ D.1538 ])
        (plus:SI (subreg:SI (mem:DI (post_inc:SI (reg:SI 41 [ ivtmp.13 ])) [1
MEM[base: _17, offset: 0B]+0 S8 A16]) 0)
            (const_int -1 [0xffffffffffffffff]))) autoinc.c:4 133
{*addsi3_internal}
     (expr_list:REG_INC (reg:SI 41 [ ivtmp.13 ])
        (nil)))

into

(insn 40 20 21 4 (set (reg:SI 1 %d1 [orig:47 D.1538 ] [47])
        (mem:SI (post_inc:SI (reg:SI 8 %a0 [orig:41 ivtmp.13 ] [41])) [1
MEM[base: _17, offset: 0B]+0 S4 A16])) autoinc.c:4 37 {*movsi_m68k}
     (expr_list:REG_INC (reg:SI 8 %a0 [orig:41 ivtmp.13 ] [41])
        (nil)))

without compensating for the fact that POST_INC depends on the mode of the
containing MEM wrt to the amount to increment.

The bug was introduced by the autoinc changes in r150588, but it probably just
exposed a latent bug in reload.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/66087] Invalid narrowing of MEM with containing POST_INC
  2015-05-09 11:35 [Bug rtl-optimization/66087] New: Invalid narrowing of MEM with containing POST_INC schwab@linux-m68k.org
@ 2015-05-09 15:30 ` pinskia at gcc dot gnu.org
  2015-07-10 19:52 ` schwab@linux-m68k.org
  2020-04-18 20:26 ` law at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-05-09 15:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66087

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Good old allowing subreg of a mem as register operand before reload.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/66087] Invalid narrowing of MEM with containing POST_INC
  2015-05-09 11:35 [Bug rtl-optimization/66087] New: Invalid narrowing of MEM with containing POST_INC schwab@linux-m68k.org
  2015-05-09 15:30 ` [Bug rtl-optimization/66087] " pinskia at gcc dot gnu.org
@ 2015-07-10 19:52 ` schwab@linux-m68k.org
  2020-04-18 20:26 ` law at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: schwab@linux-m68k.org @ 2015-07-10 19:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66087

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> ---
I think combine should reject this.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/66087] Invalid narrowing of MEM with containing POST_INC
  2015-05-09 11:35 [Bug rtl-optimization/66087] New: Invalid narrowing of MEM with containing POST_INC schwab@linux-m68k.org
  2015-05-09 15:30 ` [Bug rtl-optimization/66087] " pinskia at gcc dot gnu.org
  2015-07-10 19:52 ` schwab@linux-m68k.org
@ 2020-04-18 20:26 ` law at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: law at redhat dot com @ 2020-04-18 20:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66087

--- Comment #5 from Jeffrey A. Law <law at redhat dot com> ---
Interestingly enough it fails in a similar manner with LRA, but I agree that
avoiding this earlier in the pipeline is preferable.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-18 20:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-09 11:35 [Bug rtl-optimization/66087] New: Invalid narrowing of MEM with containing POST_INC schwab@linux-m68k.org
2015-05-09 15:30 ` [Bug rtl-optimization/66087] " pinskia at gcc dot gnu.org
2015-07-10 19:52 ` schwab@linux-m68k.org
2020-04-18 20:26 ` law at redhat dot com

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).