public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/97071] New: Fails to CSE / inherit constant pool load
@ 2020-09-16 13:45 rguenth at gcc dot gnu.org
  2020-09-16 13:49 ` [Bug rtl-optimization/97071] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-16 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97071
           Summary: Fails to CSE / inherit constant pool load
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

double foo (double x)
{
  return x * -3. + 3.;
}

compiles to

0:      addis 2,12,.TOC.-.LCF0@ha
        addi 2,2,.TOC.-.LCF0@l
        .localentry     foo,.-foo
        addis 9,2,.LC0@toc@ha
        lfd 12,.LC0@toc@l(9)
        addis 9,2,.LC2@toc@ha
        lfd 0,.LC2@toc@l(9)
        fmadd 1,1,12,0
        blr

...

.LC0:   
        .long   0
        .long   -1073217536
        .align 3
.LC2:   
        .long   0
        .long   1074266112

but CSE or reload inheritance could have replaced the add of + 3. with
subtraction of the available -3. constant.  Might be more difficult to
pull off on x86 where the add/mul has memory operands.

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

end of thread, other threads:[~2022-01-11 13:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 13:45 [Bug rtl-optimization/97071] New: Fails to CSE / inherit constant pool load rguenth at gcc dot gnu.org
2020-09-16 13:49 ` [Bug rtl-optimization/97071] " rguenth at gcc dot gnu.org
2020-09-16 14:07 ` jakub at gcc dot gnu.org
2020-09-16 14:14 ` rguenth at gcc dot gnu.org
2020-09-16 14:15 ` rguenth at gcc dot gnu.org
2020-09-16 14:18 ` rguenth at gcc dot gnu.org
2020-09-16 17:46 ` segher at gcc dot gnu.org
2022-01-11 12:12 ` rguenth at gcc dot gnu.org
2022-01-11 12:54 ` segher at gcc dot gnu.org
2022-01-11 13:14 ` rguenth at gcc dot gnu.org

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