public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/98952] New: powerpc*: __trampoline_setup inverted test for trampoline size
@ 2021-02-03 14:07 tuliom at ascii dot art.br
  2021-02-03 21:04 ` [Bug libgcc/98952] " bergner at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tuliom at ascii dot art.br @ 2021-02-03 14:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98952
           Summary: powerpc*: __trampoline_setup inverted test for
                    trampoline size
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tuliom at ascii dot art.br
  Target Milestone: ---

In tramp.S, we have the following:

/* R3 = stack address to store trampoline */
/* R4 = length of trampoline area */
/* R5 = function address */
/* R6 = static chain */

FUNC_START(__trampoline_setup)
...
        li      r8,trampoline_size      /* verify that the trampoline is big
enough */
        cmpw    cr1,r8,r4
...
        blt     cr1,.Labort

It's aborting if r8 < r4.
However, I expected it to abort if r4 < r8, which means the allocated
trampoline area is not enough to fit the trampoline.

One could replace li + cmpw with just:

        cmpwi    cr1,r4,trampoline_size

I can't reproduce this issue on GCC because the allocated length (r4) is always
equals to the required length (r8).

However, this happens when mixing other compilers, e.g.
https://github.com/JuliaLang/julia/issues/32154#issuecomment-766536590

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

end of thread, other threads:[~2021-09-11 14:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 14:07 [Bug libgcc/98952] New: powerpc*: __trampoline_setup inverted test for trampoline size tuliom at ascii dot art.br
2021-02-03 21:04 ` [Bug libgcc/98952] " bergner at gcc dot gnu.org
2021-02-03 21:47 ` segher at gcc dot gnu.org
2021-04-09 19:47 ` meissner at gcc dot gnu.org
2021-04-23 22:17 ` cvs-commit at gcc dot gnu.org
2021-04-23 23:48 ` segher at gcc dot gnu.org
2021-04-26 22:43 ` cvs-commit at gcc dot gnu.org
2021-04-26 23:59 ` cvs-commit at gcc dot gnu.org
2021-04-27  2:45 ` cvs-commit at gcc dot gnu.org
2021-04-27 14:53 ` cvs-commit at gcc dot gnu.org
2021-04-27 15:45 ` meissner at gcc dot gnu.org
2021-09-11 14:29 ` pinskia 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).