public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/105917] New: Missed passthru jump function
@ 2022-06-10 12:14 hubicka at gcc dot gnu.org
  2022-06-10 13:00 ` [Bug ipa/105917] [10/11/12/13 regression] " hubicka at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: hubicka at gcc dot gnu.org @ 2022-06-10 12:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105917
           Summary: Missed passthru jump function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

In this testcase:
struct a {int a;};
struct b {int b; struct a a;};

__attribute__ ((noinline))
static int
reta (struct a a)
{
        return a.a;
}
__attribute__ ((noinline))
static int 
retba (struct b b)
{
  struct a *a = &b.a;
  return reta(*a);
}
int
main()
{
  struct b b = {1, {0}};
  return retba (b);
}

There is aggregat passthru from retba to reta but we get:

  _2 = reta (MEM[(struct a *)&b + 4B]);

Analyzing function: retba/1
  function  retba/1 parameter descriptors:
    param #0 b used undescribed_use
  Jump functions of caller  retba/1:
    callsite  retba/1 -> reta/0 :
       param 0: UNKNOWN
         Unknown bits
         Unknown VR

I constructed this to check dubious check for MEM_REF requiring offset to be 0.
However surprisingly we miss the following too:

struct a {int a;};
struct b {int b; struct a a;};

__attribute__ ((noinline))
static int
reta (struct a a)
{
        return a.a;
}
__attribute__ ((noinline))
static int 
retba (struct b b)
{
  //struct a *a = &b.a;
  //return reta(*a);
  return reta (b.a);
}
int
main()
{
  struct b b = {1, {0}};
  return retba (b);
}

  Jump functions of caller  retba/1:
    callsite  retba/1 -> reta/0 :
       param 0: UNKNOWN
         Unknown bits
         Unknown VR

I wonder which cases actually works :)

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

end of thread, other threads:[~2023-07-07 10:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 12:14 [Bug ipa/105917] New: Missed passthru jump function hubicka at gcc dot gnu.org
2022-06-10 13:00 ` [Bug ipa/105917] [10/11/12/13 regression] " hubicka at gcc dot gnu.org
2022-06-14  7:31 ` rguenth at gcc dot gnu.org
2022-06-15 12:43 ` marxin at gcc dot gnu.org
2022-06-28 10:49 ` jakub at gcc dot gnu.org
2022-07-25 16:03 ` rguenth at gcc dot gnu.org
2023-07-07 10:43 ` [Bug ipa/105917] [11/12/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).