public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Question unused function parameter data garbage collection
@ 2022-09-12 11:21 Fredrik Hederstierna
  2022-09-12 12:30 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Fredrik Hederstierna @ 2022-09-12 11:21 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: text/plain, Size: 753 bytes --]

Hi,

We have a function that does not used an in-parameter, simplified example:

void test_unused_string_param_gc(const char* unused)
{
   // empty
}

Though when we have calls to this function, the arguments are still put in the memory, causing unnecessary flash memory usage for 'dead parameters'.

Example if having a call (from another file) as

      test_unused_string_param_gc("This string is not garbage-collected?");

Then this string will still be added to our finally build binary?

We compile with -Os, and have tried different flags to try get rid of this dead parameter data,
do anyone know if this is the expected behavior and why? Or if we are missing any optimization flags, like LTO etc?

Best Regards,
Fredrik


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

end of thread, other threads:[~2022-09-12 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 11:21 Question unused function parameter data garbage collection Fredrik Hederstierna
2022-09-12 12:30 ` Richard Biener
2022-09-12 14:48   ` Martin Jambor

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