Menu

#2903 Casting function pointer to void* for pdk

closed-fixed
None
PDK
5
2026-05-15
2019-04-09
No

The pdk backends generate wrong code for casting a function pointer to void*:

void *f (void);
void *
f (void)
{
  return f;
}

results in:

_f:
mov a, #(_f + 0)
clear   p

This affects regression test gcc-torture-execute-20041212-1. Though the code for the cast is wrong in two places, so that in the end both wrong values compare equal, and the test passes. But in the pdk branch, the linker reports an error.

Philipp

Discussion

  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
    • Category: other --> PDK
     
  • Philipp Klaus Krause

    Fixed in [r16530]. Sample code still affected (for pdk14 only) by [bugs:#397].

     

    Related

    Bugs: #397
    Commit: [r16530]


Log in to post a comment.

Monday.com Logo