SlideShare a Scribd company logo
Fix LRA assign same hard
register with overlapped pseudos
Shiva
shiva0217@gmail.com
May 2013
Problem description
r0[r477] = sp + 112;
r0[r565] = sp;
r13 = mem [r0[r565] + 136]
…
r0[r61] = r0[r477] + r5;
The error cause by assign different pseudo register
to same hardware register with live time overlapped.
 When the r477 have been created
 r477 = sp’
 After the stack have been changed
$r477 = sp + 112;
r477 = sp’
= sp + 112
sp
sp’: old sp
sp: new sp
Why assign to same register?
 However, when assign hardware register
 The register content record didn’t notice the
pseudo content have been changed
It record as (r477 == r565)
Therefore, it think live range overlap is OK because
the register content is still equal
How to fix the bug
 Add offset in register content structure
 The offset from eliminate register(sp) to pseudo
register
 Update the register content offset when the
eliminate offset have been changed.
r477 = sp’
= sp + 112
sp
SFP
Previous
Eliminate
offset
Current
Eliminate
offsetreg_content_offset[r477]
+=(Curr_elim_offset – prev_elim_offset)
saved arguments for
vararg functions
Callee saved regs
Local variables
Outgoing argument
Return address
Last_frame address
(SOFT) FRAME_POINTER
ARGUMENT_POINTER
HARD_FRAME_POINTER
STACK_POINTER
Relative mailing list
 http://gcc.gnu.org/ml/gcc/2013-04/msg00144.ht
 http://gcc.gnu.org/ml/gcc-patches/2013-
04/msg01350.html

More Related Content

PDF
Flare and TensorFlare: Native Compilation for Spark and TensorFlow Pipelines ...
PDF
Creating new service name for oracle database
PDF
A Peek Under the Aura Hood
KEY
Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...
PDF
Regular expressions, Alex Perry, Google, PyCon2014
PDF
Need to make a horizontal change across 100+ microservices? No worries, Sheph...
PPT
Exception handling poirting in gcc
PPT
Gcc porting
Flare and TensorFlare: Native Compilation for Spark and TensorFlow Pipelines ...
Creating new service name for oracle database
A Peek Under the Aura Hood
Tim Panton - Presentation at Emerging Communications Conference & Awards (eCo...
Regular expressions, Alex Perry, Google, PyCon2014
Need to make a horizontal change across 100+ microservices? No worries, Sheph...
Exception handling poirting in gcc
Gcc porting

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Approach and Philosophy of On baking technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
A Presentation on Artificial Intelligence
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
A Presentation on Touch Screen Technology
PPTX
1. Introduction to Computer Programming.pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
MIND Revenue Release Quarter 2 2025 Press Release
Web App vs Mobile App What Should You Build First.pdf
Hindi spoken digit analysis for native and non-native speakers
Programs and apps: productivity, graphics, security and other tools
Approach and Philosophy of On baking technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A Presentation on Artificial Intelligence
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
NewMind AI Weekly Chronicles - August'25-Week II
DP Operators-handbook-extract for the Mautical Institute
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
cloud_computing_Infrastucture_as_cloud_p
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A Presentation on Touch Screen Technology
1. Introduction to Computer Programming.pptx
1 - Historical Antecedents, Social Consideration.pdf
Chapter 5: Probability Theory and Statistics
A comparative study of natural language inference in Swahili using monolingua...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Group 1 Presentation -Planning and Decision Making .pptx
Ad
Ad

Fix gcc lra bug

  • 1. Fix LRA assign same hard register with overlapped pseudos Shiva shiva0217@gmail.com May 2013
  • 2. Problem description r0[r477] = sp + 112; r0[r565] = sp; r13 = mem [r0[r565] + 136] … r0[r61] = r0[r477] + r5; The error cause by assign different pseudo register to same hardware register with live time overlapped.
  • 3.  When the r477 have been created  r477 = sp’  After the stack have been changed $r477 = sp + 112; r477 = sp’ = sp + 112 sp sp’: old sp sp: new sp
  • 4. Why assign to same register?  However, when assign hardware register  The register content record didn’t notice the pseudo content have been changed It record as (r477 == r565) Therefore, it think live range overlap is OK because the register content is still equal
  • 5. How to fix the bug  Add offset in register content structure  The offset from eliminate register(sp) to pseudo register  Update the register content offset when the eliminate offset have been changed. r477 = sp’ = sp + 112 sp SFP Previous Eliminate offset Current Eliminate offsetreg_content_offset[r477] +=(Curr_elim_offset – prev_elim_offset)
  • 6. saved arguments for vararg functions Callee saved regs Local variables Outgoing argument Return address Last_frame address (SOFT) FRAME_POINTER ARGUMENT_POINTER HARD_FRAME_POINTER STACK_POINTER
  • 7. Relative mailing list  http://gcc.gnu.org/ml/gcc/2013-04/msg00144.ht  http://gcc.gnu.org/ml/gcc-patches/2013- 04/msg01350.html