Skip to content

Remove rbimpl_rstring_getmem() usage#15113

Merged
nagachika merged 3 commits intoruby:masterfrom
nagachika:workaround_gcc_15_2_1_ipa-modref
Nov 11, 2025
Merged

Remove rbimpl_rstring_getmem() usage#15113
nagachika merged 3 commits intoruby:masterfrom
nagachika:workaround_gcc_15_2_1_ipa-modref

Conversation

@nagachika
Copy link
Member

Remove rbimpl_rstring_getmem() usage as workaround for GCC 15.2.1 optimization bug.
see Bug #21655

@nagachika nagachika requested a review from XrXr November 9, 2025 06:28
@XrXr
Copy link
Member

XrXr commented Nov 9, 2025

BTW other than dodging the optimizer bug, it seems strictly better to read out ptr and len directly instead of writing to a local struct and then reading the fields back out again. Yes, optimizers could do struct-to-scalar replacement but it doesn't happen on lower optimization levels and doesn't always happen even on -O2 -march=amdfam10.

Copy link
Member

@XrXr XrXr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested 4e361bc with CFLAGS=-O2 -pipe -march=amdfam10 and it builds and runs fine.

@nagachika
Copy link
Member Author

@XrXr Thanks for the confirmation. I will merge it.

@nagachika nagachika merged commit 48dce78 into ruby:master Nov 11, 2025
88 checks passed
@nagachika nagachika deleted the workaround_gcc_15_2_1_ipa-modref branch November 11, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants