Commit 60f5b00
Fix: phi coalesce propagation creates overlapping register assignments
The phi coalesce step unconditionally copied register assignments from
phi destinations to backedge sources without checking for conflicts.
This created 5974 overlapping register assignments across SQLite, where
two live values shared the same physical register simultaneously.
Fix: check for interval conflicts before propagating phi coalesce
assignments. Only coalesce when the backedge source's live interval
doesn't overlap with any other value in the same register.
Results: overlaps reduced from 5974 to 1523 (74% reduction).
SQLite CREATE TABLE now returns rc=21 (SQLITE_MISUSE) instead of
rc=103 (corrupted random value).
Also adds CCC_VERIFY_REGALLOC=1 diagnostic that detects overlapping
register assignments at compile time.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 78cf89a commit 60f5b00
1 file changed
Lines changed: 45 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
| 364 | + | |
363 | 365 | | |
364 | 366 | | |
365 | | - | |
366 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
367 | 387 | | |
368 | 388 | | |
369 | 389 | | |
| |||
479 | 499 | | |
480 | 500 | | |
481 | 501 | | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
482 | 525 | | |
483 | 526 | | |
484 | 527 | | |
| |||
0 commit comments