← All tasks

ccx-vuln-remed-126

Sonnet + Sourcegraph MCP vs Fable baseline. Each column is that arm's median-reward trial.

Sonnet 4.6 + MCP
0.759
mean reward, n=3
Fable 5
0.735
mean reward, n=3
Sonnet 4.6 + MCP
Sourcegraph, no local source
0.764 rewardmean 0.759 (n=3)76 turns76 tools$1.54
Instruction sent
# IMPORTANT: Source Code Access

**Local source files are not present.** Your workspace does not contain source code. You **MUST** use Sourcegraph MCP tools to discover, read, and understand code before making any changes.

**Target Repositories (version-pinned mirrors):**

- `github.com/sg-evals/gcc--96dfb333` — use `repo:^github.com/sg-evals/gcc--96dfb333$` filter
- `github.com/sg-evals/llvm-project--a8f3c97d` — use `repo:^github.com/sg-evals/llvm-project--a8f3c97d$` filter

Scope ALL keyword_search/nls_search queries to these repos.
Use the repo name as the `repo` parameter for read_file/go_to_definition/find_references.


## Required Workflow

1. **Search first** — Use MCP tools to find relevant files and understand existing patterns
2. **Read remotely** — Use `sg_read_file` to read full file contents from Sourcegraph
3. **Edit locally** — Use Edit, Write, and Bash to create or modify files in your working directory
4. **Verify locally** — Run tests with Bash to check your changes
5. **Produce answer.json** — After completing your edits, also write `/workspace/answer.json` summarizing your work:
   ```json
   {
     "analysis": {
       "summary": "Brief description of your approach",
       "files_examined": [{"path": "file.ext", "description": "..."}],
       "reasoning": "Detailed explanation or analysis"
     },
     "changes": [
       {"file": "path.ext", "description": "...", "diff": "unified diff"}
     ]
   }
   ```
   Include `changes` with unified diffs for every file you modified. For analysis-only tasks, omit `changes` and focus on `analysis`.

## Tool Selection

| Goal | Tool |
|------|------|
| Exact symbol/string | `sg_keyword_search` |
| Concepts/semantic search | `sg_nls_search` |
| Trace usage/callers | `sg_find_references` |
| See implementation | `sg_go_to_definition` |
| Read full file | `sg_read_file` |
| Browse structure | `sg_list_files` |
| Find repos | `sg_list_repos` |
| Search commits | `sg_commit_search` |
| Track changes | `sg_diff_search` |
| Compare versions | `sg_compare_revisions` |

**Decision logic:**
1. Know the exact symbol? → `sg_keyword_search`
2. Know the concept, not the name? → `sg_nls_search`
3. Need definition of a symbol? → `sg_go_to_definition`
4. Need all callers/references? → `sg_find_references`
5. Need full file content? → `sg_read_file`

## Scoping (Always Do This)

```
repo:^github.com/ORG/REPO$           # Exact repo (preferred)
repo:github.com/ORG/                 # All repos in org
file:.*\.ts$                         # TypeScript only
file:src/api/                        # Specific directory
```

Start narrow. Expand only if results are empty.

## Efficiency Rules

- Chain searches logically: search → read → references → definition
- Don't re-search for the same pattern; use results from prior calls
- Prefer `sg_keyword_search` over `sg_nls_search` when you have exact terms
- Read 2-3 related files before synthesising, rather than one at a time
- Don't read 20+ remote files without writing code — once you understand the pattern, start implementing

## If Stuck

If MCP search returns no results:
1. Broaden the search query (synonyms, partial identifiers)
2. Try `sg_nls_search` for semantic matching
3. Use `sg_list_files` to browse the directory structure
4. Use `sg_list_repos` to verify the repository name

---

**Sourcegraph Repositories:** `github.com/sg-evals/gcc--96dfb333`, `github.com/sg-evals/llvm-project--a8f3c97d`

# IMPORTANT: Source Code Access

**Local source files are not present.** Your workspace does not contain source code. You **MUST** use Sourcegraph MCP tools to discover, read, and understand code before making any changes.

**Target Repositories (version-pinned mirrors):**

- `github.com/sg-evals/llvm-project--a8f3c97d` — use `repo:^github.com/sg-evals/llvm-project--a8f3c97d$` filter
- `github.com/sg-evals/gcc--96dfb333` — use `repo:^github.com/sg-evals/gcc--96dfb333$` filter

Scope ALL keyword_search/nls_search queries to these repos.
Use the repo name as the `repo` parameter for read_file/go_to_definition/find_references.


## Required Workflow

1. **Search first** — Use MCP tools to find relevant files and understand existing patterns
2. **Read remotely** — Use `sg_read_file` to read full file contents from Sourcegraph
3. **Edit locally** — Use Edit, Write, and Bash to create or modify files in your working directory
4. **Verify locally** — Run tests with Bash to check your changes

## Tool Selection

| Goal | Tool |
|------|------|
| Exact symbol/string | `sg_keyword_search` |
| Concepts/semantic search | `sg_nls_search` |
| Trace usage/callers | `sg_find_references` |
| See implementation | `sg_go_to_definition` |
| Read full file | `sg_read_file` |
| Browse structure | `sg_list_files` |
| Find repos | `sg_list_repos` |
| Search commits | `sg_commit_search` |
| Track changes | `sg_diff_search` |
| Compare versions | `sg_compare_revisions` |

**Decision logic:**
1. Know the exact symbol? -> `sg_keyword_search`
2. Know the concept, not the name? -> `sg_nls_search`
3. Need definition of a symbol? -> `sg_go_to_definition`
4. Need all callers/references? -> `sg_find_references`
5. Need full file content? -> `sg_read_file`

## Scoping (Always Do This)

```
repo:^github.com/ORG/REPO$           # Exact repo (preferred)
repo:github.com/ORG/                 # All repos in org
file:.*\.ts$                         # TypeScript only
file:src/api/                        # Specific directory
```

Start narrow. Expand only if results are empty.

## Efficiency Rules

- Chain searches logically: search -> read -> references -> definition
- Don't re-search for the same pattern; use results from prior calls
- Prefer `sg_keyword_search` over `sg_nls_search` when you have exact terms
- Read 2-3 related files before synthesising, rather than one at a time
- Don't read 20+ remote files without writing code — once you understand the pattern, start implementing

## If Stuck

If MCP search returns no results:
1. Broaden the search query (synonyms, partial identifiers)
2. Try `sg_nls_search` for semantic matching
3. Use `sg_list_files` to browse the directory structure
4. Use `sg_list_repos` to verify the repository name

---

**Sourcegraph Repositories:** `github.com/sg-evals/llvm-project--a8f3c97d`, `github.com/sg-evals/gcc--96dfb333`

# GCC Stack Clash Protection Implementation Audit

## Your Task

Audit the stack clash protection implementation in GCC. Find all C/C++ source files in `gcc-mirror/gcc` that implement stack clash mitigation. Specifically: 1. The file that implements stack clash probing for x86_64 targets (`gcc/config/i386/i386.cc` — look for `stack_clash_protection`). 2. The file that implements the generic stack clash expansion (`gcc/explow.cc` — look for `anti_adjust_stack_and_probe`). 3. The header where `TARGET_STACK_CLASH_PROTECTION` is declared or defined. 4. The test file under `gcc/testsuite/gcc.target/i386/` that validates stack clash protection (look for `stack-clash-*`). 5. The common options file where `-fstack-clash-protection` is defined (`gcc/common.opt`). Report each file path and the key function or definition.

## Context

You are working on a codebase task involving repos from the security domain.

## Available Resources

No local repositories are pre-checked out.

**Note:** Additional repositories are accessible via Sourcegraph MCP tools:
- `sg-evals/llvm-project--a8f3c97d` (llvm/llvm-project)
- `sg-evals/gcc--96dfb333` (gcc-mirror/gcc)

## Output Format

Create a file at `/workspace/answer.json` with your findings in the following structure:

```json
{
  "files": [
    {"repo": "org/repo-name", "path": "relative/path/to/file.go"}
  ],
  "symbols": [
    {"repo": "org/repo-name", "path": "relative/path/to/file.go", "symbol": "SymbolName"}
  ],
  "chain": [
    {"repo": "org/repo-name", "path": "relative/path/to/file.go", "symbol": "FunctionName"}
  ],
  "text": "Narrative explanation of your findings, citing repos and file paths."
}
```

Include only the fields relevant to this task. Your answer is evaluated against a closed-world oracle — completeness matters.

## Evaluation

Your answer will be scored on:
- **File recall and precision**: Did you find all relevant files?

## COVERAGE REQUIREMENTS — Do Not Write answer.json Too Early

Before writing `answer.json`, you **must** verify coverage across all major
subsystems named in the task.

**Minimum workflow:**
1. **Enumerate** — Search for all relevant directories and files across the codebase.
2. **Read** — Read representative implementation files for each subsystem.
3. **Extract** — Extract the key symbols required by the task (not just file paths).
4. **Gap check** — List any providers, services, or middleware layers mentioned in
   the task that are NOT yet backed by a concrete file read. If any gaps exist,
   search for them before proceeding.
5. **Only then** write `answer.json`.

Do not stop after finding a plausible initial set of paths. The task rewards
**broad, complete coverage** of required files and symbols.

## PRE-TEST SANITY CHECK

Before running tests, perform this check:
1. List every file you have modified or created.
2. For each file, state in one sentence why it is necessary for the task.
3. If any file is unrelated to the stated task, **do not write it** (or revert
   if already written).

Use MCP for discovery and confirmation. Use local repo state only for narrow
patching logic. Do not use `sg_read_file` output as a template to copy wholesale
into the workspace.
Conversation (570)
#TypeToolText
1system-
2system-
3system-
4system-
5system-
6system-
7system-
8assistant-
I'll search for the relevant GCC stack clash protection files using Sourcegraph MCP tools.
9assistantToolSearch
10userToolSearch
{"matches": ["mcp__sourcegraph__sg_keyword_search", "mcp__sourcegraph__sg_read_file", "mcp__sourcegraph__sg_list_files"], "query": "select:mcp__sourcegraph__sg_keyword_search,mcp__sourcegraph__sg_read_file,mcp__sourcegraph__sg_list_files", "total_deferred_tools": 33}
11system-
12system-
13system-
14system-
15assistant-
Now let me search for all five target items in parallel.
16assistantmcp__sourcegraph__sg_keyword_search
17usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
18assistantmcp__sourcegraph__sg_keyword_search
19usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/explow.cc\n2200: void\n2201: anti_adjust_stack_and_probe (rtx size, bool adjust_back)\n2202: {\n2203: \n2071: void\n2072: anti_adjust_stack_and_probe_stack_clash (rtx size)\n2073: {\n2074: \n1643:       if (flag_stack_check && STACK_CHECK_MOVING_SP)\n1644: \tanti_adjust_stack_and_probe (size, false);\n1645:       else if (flag_stack_clash_protection)\n1646: \tanti_adjust_stack_and_probe_stack_clash (size);\n1647:       else\n1648: \n"}
20assistantmcp__sourcegraph__sg_keyword_search
21usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\n16846: \n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\n16849:   riscv_stack_clash_protection_alloca_probe_range\n16850: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.cc\n2744: /* Default implementation for\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\n2746: HOST_WIDE_INT\n2747: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi\n3771: \n3772: @deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void)\n3773: Some targets have an ABI defined interval for which no probing needs to be done.\n3774: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi.in\n2997: \n2998: @hook TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n2999: \n3000: \n"}
22assistantmcp__sourcegraph__sg_keyword_search
23usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr109780-3.c\n1: /* { dg-do run  { target avx2_runtime } }  */\n2: /* { dg-options \"-O2 -mavx2 -mtune=znver1 -fno-stack-protector -fno-stack-clash-protection\" } */\n3: \n4: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-clash-protection.c\n1: /* { dg-do compile } */\n2: /* { dg-options \"-O2 -fstack-clash-protection\" } */\n3: \n4: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr84128.c\n1: /* { dg-do run } */\n2: /* { dg-options \"-O2 -march=i686 -mtune=generic -fstack-clash-protection\" } */\n3: /* { dg-require-effective-target ia32 } */\n4: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr83994.c\n2: /* { dg-require-effective-target fpic } */\n3: /* { dg-options \"-O2 -march=i686 -fpic -fstack-clash-protection\" } */\n4: /* { dg-require-effective-target ia32 } */\n5: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr84064.c\n1: /* { dg-do compile } */\n2: /* { dg-options \"-O2 -march=i686 -fstack-clash-protection\" } */\n3: /* { dg-require-effective-target ia32 } */\n4: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-check-17.c\n1: /* { dg-do compile } */\n2: /* { dg-options \"-O2 -fstack-clash-protection -mtune=generic -fomit-frame-pointer -mnoreturn-no-callee-saved-registers\" } */\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\n4: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-check-11.c\n1: /* { dg-do compile } */\n2: /* { dg-options \"-O2 -fstack-clash-protection -mtune=generic -fno-stack-protector\" } */\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\n4: \n\n# github...
24assistantmcp__sourcegraph__sg_keyword_search
25usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/common.opt\n3053: \n3054: fstack-clash-protection\n3055: Common Var(flag_stack_clash_protection) Optimization\n3056: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/common.opt.urls\n1453: \n1454: fstack-clash-protection\n1455: UrlSuffix(gcc/Instrumentation-Options.html#index-fno-stack-clash-protection)\n1456: \n"}
26system-
27system-
28system-
29system-
30system-
31system-
32system-
33system-
34system-
35system-
36system-
37system-
38assistant-
Good initial results. Let me now search for the i386.cc stack clash implementation and the `TARGET_STACK_CLASH_PROTECTION` header declaration.
39assistantmcp__sourcegraph__sg_keyword_search
40usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
41assistantmcp__sourcegraph__sg_keyword_search
42usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
43assistantmcp__sourcegraph__sg_keyword_search
44usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-clash-protection.c\n1: /* { dg-do compile } */\n2: /* { dg-options \"-O2 -fstack-clash-protection\" } */\n3: \n4: \n"}
45system-
46system-
47system-
48system-
49assistantmcp__sourcegraph__sg_keyword_search
50usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
51assistantmcp__sourcegraph__sg_keyword_search
52usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.cc\n2744: /* Default implementation for\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\n2746: HOST_WIDE_INT\n2747: \n"}
53system-
54system-
55system-
56system-
57assistantmcp__sourcegraph__sg_keyword_search
58usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.h\n304: extern machine_mode default_mode_for_floating_type (enum tree_index);\n305: extern HOST_WIDE_INT default_stack_clash_protection_alloca_probe_range (void);\n306: extern void default_select_early_remat_modes (sbitmap);\n307: \n"}
59assistantmcp__sourcegraph__sg_keyword_search
60usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
61system-
62system-
63system-
64assistantmcp__sourcegraph__sg_list_files
65usermcp__sourcegraph__sg_list_files
{"text":"gcc/config/i386/adxintrin.h\ngcc/config/i386/ammintrin.h\ngcc/config/i386/amxavx512intrin.h\ngcc/config/i386/amxbf16intrin.h\ngcc/config/i386/amxcomplexintrin.h\ngcc/config/i386/amxfp16intrin.h\ngcc/config/i386/amxfp8intrin.h\ngcc/config/i386/amxint8intrin.h\ngcc/config/i386/amxmovrsintrin.h\ngcc/config/i386/amxtf32intrin.h\ngcc/config/i386/amxtileintrin.h\ngcc/config/i386/amxtransposeintrin.h\ngcc/config/i386/athlon.md\ngcc/config/i386/atom.md\ngcc/config/i386/att.h\ngcc/config/i386/avx10_2bf16intrin.h\ngcc/config/i386/avx10_2convertintrin.h\ngcc/config/i386/avx10_2copyintrin.h\ngcc/config/i386/avx10_2mediaintrin.h\ngcc/config/i386/avx10_2minmaxintrin.h\ngcc/config/i386/avx10_2satcvtintrin.h\ngcc/config/i386/avx2intrin.h\ngcc/config/i386/avx5124fmapsintrin.h\ngcc/config/i386/avx5124vnniwintrin.h\ngcc/config/i386/avx512bf16intrin.h\ngcc/config/i386/avx512bf16vlintrin.h\ngcc/config/i386/avx512bitalgintrin.h\ngcc/config/i386/avx512bitalgvlintrin.h\ngcc/config/i386/avx512bmmintrin.h\ngcc/config/i386/avx512bmmvlintrin.h\ngcc/config/i386/avx512bwintrin.h\ngcc/config/i386/avx512cdintrin.h\ngcc/config/i386/avx512dqintrin.h\ngcc/config/i386/avx512erintrin.h\ngcc/config/i386/avx512fintrin.h\ngcc/config/i386/avx512fp16intrin.h\ngcc/config/i386/avx512fp16vlintrin.h\ngcc/config/i386/avx512ifmaintrin.h\ngcc/config/i386/avx512ifmavlintrin.h\ngcc/config/i386/avx512pfintrin.h\ngcc/config/i386/avx512vbmi2intrin.h\ngcc/config/i386/avx512vbmi2vlintrin.h\ngcc/config/i386/avx512vbmiintrin.h\ngcc/config/i386/avx512vbmivlintrin.h\ngcc/config/i386/avx512vlbwintrin.h\ngcc/config/i386/avx512vldqintrin.h\ngcc/config/i386/avx512vlintrin.h\ngcc/config/i386/avx512vnniintrin.h\ngcc/config/i386/avx512vnnivlintrin.h\ngcc/config/i386/avx512vp2intersectintrin.h\ngcc/config/i386/avx512vp2intersec...
66assistantmcp__sourcegraph__sg_keyword_search
67usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
68system-
69system-
70system-
71system-
72system-
73system-
74system-
75system-
76assistant-
Let me search in i386-expand.cc and also look at the `target.def` for `TARGET_STACK_CLASH_PROTECTION`.
77assistantmcp__sourcegraph__sg_keyword_search
78usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
79assistantmcp__sourcegraph__sg_keyword_search
80usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/target.def\n6534: DEFHOOK\n6535: (stack_clash_protection_alloca_probe_range,\n6536:  \"Some targets have an ABI defined interval for which no probing needs to be done.\\n\\\n6537: \n6544:  HOST_WIDE_INT, (void),\n6545:  default_stack_clash_protection_alloca_probe_range)\n6546: \n6547: \n"}
81system-
82system-
83system-
84system-
85system-
86system-
87assistantmcp__sourcegraph__sg_keyword_search
88usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
89assistantmcp__sourcegraph__sg_keyword_search
90usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
91system-
92system-
93system-
94system-
95system-
96system-
97assistantmcp__sourcegraph__sg_keyword_search
98usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n21106:   \"\"\n21107:   \"ix86_expand_prologue (); DONE;\")\n21108: \n21109: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n33: extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);\n34: extern void ix86_expand_prologue (void);\n35: extern void ix86_maybe_emit_epilogue_vzeroupper (void);\n36: \n"}
99assistantmcp__sourcegraph__sg_keyword_search
100usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
101system-
102system-
103system-
104system-
105system-
106assistant-
Let me read part of i386.cc to find stack-related code and also check the i386-expand.cc file.
107assistantmcp__sourcegraph__sg_keyword_search
108assistantmcp__sourcegraph__sg_keyword_search
109usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
110usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
111system-
112system-
113assistantmcp__sourcegraph__sg_nls_search
114usermcp__sourcegraph__sg_nls_search
{"text":"# github.com/microsoft/vscode – src/vs/workbench/contrib/testing/common/testTypes.ts\n428: \n429: export const enum TestItemExpandState {\n430: \tNotExpandable,\n431: \tExpandable,\n432: \tBusyExpanding,\n433: \tExpanded,\n434: }\n435: \n454: \texport const serialize = (item: Readonly<InternalTestItem>): Serialized => ({\n455: \t\texpand: item.expand,\n456: \t\titem: ITestItem.serialize(item.item)\n457: \n463: \t\tcontrollerId: TestId.root(serialized.item.extId),\n464: \t\texpand: serialized.expand,\n465: \t\titem: ITestItem.deserialize(uriIdentity, serialized.item)\n466: \n\n# github.com/kubernetes/kubernetes – cmd/kube-controller-manager/app/core.go\n320: \n321: func newPersistentVolumeExpanderControllerDescriptor() *ControllerDescriptor {\n322: \treturn &ControllerDescriptor{\n323: \t\tname:        names.PersistentVolumeExpanderController,\n324: \t\taliases:     []string{\"persistentvolume-expander\"},\n325: \t\tconstructor: newPersistentVolumeExpanderController,\n326: \t}\n327: \n737: \n738: func newPersistentVolumeProtectionControllerDescriptor() *ControllerDescriptor {\n739: \treturn &ControllerDescriptor{\n740: \t\tname:        names.PersistentVolumeProtectionController,\n741: \t\taliases:     []string{\"pv-protection\"},\n742: \t\tconstructor: newPersistentVolumeProtectionController,\n743: \t}\n744: \n708: \n709: func newPersistentVolumeClaimProtectionControllerDescriptor() *ControllerDescriptor {\n710: \treturn &ControllerDescriptor{\n711: \t\tname:        names.PersistentVolumeClaimProtectionController,\n712: \t\taliases:     []string{\"pvc-protection\"},\n713: \t\tconstructor: newPersistentVolumeClaimProtectionController,\n714: \t}\n715: \n\n# github.com/pytorch/pytorch – torch/fx/graph.py\n332: \n333: # get File:lineno code from stack_trace\n334: de...
115system-
116system-
117system-
118system-
119assistant-
Let me search more directly for stack probe functions in the GCC i386 code.
120assistantmcp__sourcegraph__sg_keyword_search
121usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
122assistantmcp__sourcegraph__sg_keyword_search
123usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/explow.cc\n2071: void\n2072: anti_adjust_stack_and_probe_stack_clash (rtx size)\n2073: {\n2074: \n2013: void\n2014: emit_stack_clash_protection_probe_loop_start (rtx *loop_lab,\n2015: \t\t\t\t\t      rtx *end_lab,\n2016: \n2035: void\n2036: emit_stack_clash_protection_probe_loop_end (rtx loop_lab, rtx end_loop,\n2037: \t\t\t\t\t    rtx last_addr, bool rotated)\n2038: \n"}
124system-
125system-
126system-
127system-
128system-
129system-
130system-
131system-
132system-
133assistant-
Now let me read the key files to extract exact symbols. I'll read them in parallel.
134assistantmcp__sourcegraph__sg_read_file
135usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/explow.cc%3FL2000-2220\n2000: \tfprintf (dump_file,\n2001: \t\t \"Stack clash skipped dynamic allocation and \"\n2002: \t\t \"probing residuals.\\n\");\n2003:     }\n2004: }\n2005: \n2006: /* Emit the start of an allocate/probe loop for stack\n2007:    clash protection.\n2008: \n2009:    LOOP_LAB and END_LAB are returned for use when we emit the\n2010:    end of the loop.\n2011: \n2012:    LAST addr is the value for SP which stops the loop.  */\n2013: void\n2014: emit_stack_clash_protection_probe_loop_start (rtx *loop_lab,\n2015: \t\t\t\t\t      rtx *end_lab,\n2016: \t\t\t\t\t      rtx last_addr,\n2017: \t\t\t\t\t      bool rotated)\n2018: {\n2019:   /* Essentially we want to emit any setup code, the top of loop\n2020:      label and the comparison at the top of the loop.  */\n2021:   *loop_lab = gen_label_rtx ();\n2022:   *end_lab = gen_label_rtx ();\n2023: \n2024:   emit_label (*loop_lab);\n2025:   if (!rotated)\n2026:     emit_cmp_and_jump_insns (stack_pointer_rtx, last_addr, EQ, NULL_RTX,\n2027: \t\t\t     Pmode, 1, *end_lab);\n2028: }\n2029: \n2030: /* Emit the end of a stack clash probing loop.\n2031: \n2032:    This consists of just the jump back to LOOP_LAB and\n2033:    emitting END_LOOP after the loop.  */\n2034: \n2035: void\n2036: emit_stack_clash_protection_probe_loop_end (rtx loop_lab, rtx end_loop,\n2037: \t\t\t\t\t    rtx last_addr, bool rotated)\n2038: {\n2039:   if (rotated)\n2040:     emit_cmp_and_jump_insns (stack_pointer_rtx, last_addr, NE, NULL_RTX,\n2041: \t\t\t     Pmode, 1, loop_lab);\n2042:   else\n2043:     emit_jump (loop_lab);\n2044: \n2045:   emit_label (end_loop);\n2046: \n2047: }\n2048: \n2049: /* Adjust the sta...
136assistantmcp__sourcegraph__sg_read_file
137usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/common.opt%3FL3050-3060\n3050: fstack-check\n3051: Common Alias(fstack-check=, specific, no)\n3052: Insert stack checking code into the program.  Same as -fstack-check=specific.\n3053: \n3054: fstack-clash-protection\n3055: Common Var(flag_stack_clash_protection) Optimization\n3056: Insert code to probe each page of stack space as it is allocated to protect\n3057: from stack-clash style attacks.\n3058: \n3059: ; The real option is fno-stack-limit.\n3060: fstack-limit\n3061: "}
138assistantmcp__sourcegraph__sg_read_file
139usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/testsuite/gcc.target/i386/stack-clash-protection.c\n1: /* { dg-do compile } */\n2: /* { dg-options \"-O2 -fstack-clash-protection\" } */\n3: \n4: int flag;\n5: void open();\n6: int getChar();\n7: typedef enum { QUOTE } CharType;\n8: typedef enum { UNQ } State;\n9: CharType getCharType();\n10: void expand() {\n11:   open();\n12:   if (flag)\n13:     return;\n14:   int ch = getChar();\n15:   State nextState = getCharType();\n16:   if (nextState)\n17:     while (ch)\n18:       ;\n19: }\n20: "}
140system-
141system-
142system-
143system-
144system-
145system-
146system-
147system-
148assistant-
Let me now read the target.def and i386.cc to find the specific references.
149assistantmcp__sourcegraph__sg_read_file
150usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/target.def%3FL6525-6560\n6525: that shouldn't be used.\\n\\\n6526: \\n\\\n6527: (However, if this class is not included in @code{GENERAL_REGS} and all\\n\\\n6528: of the insn patterns whose constraints permit this class are\\n\\\n6529: controlled by target switches, then GCC will automatically avoid using\\n\\\n6530: these registers when the target switches are opposed to them.)\",\n6531:  void, (void),\n6532:  hook_void_void)\n6533: \n6534: DEFHOOK\n6535: (stack_clash_protection_alloca_probe_range,\n6536:  \"Some targets have an ABI defined interval for which no probing needs to be done.\\n\\\n6537: When a probe does need to be done this same interval is used as the probe distance\\n\\\n6538: up when doing stack clash protection for alloca.\\n\\\n6539: On such targets this value can be set to override the default probing up interval.\\n\\\n6540: Define this variable to return nonzero if such a probe range is required or zero otherwise.\\n\\\n6541: Defining this hook also requires your functions which make use of alloca to have at least 8 byes\\n\\\n6542: of outgoing arguments.  If this is not the case the stack will be corrupted.\\n\\\n6543: You need not define this macro if it would always have the value zero.\",\n6544:  HOST_WIDE_INT, (void),\n6545:  default_stack_clash_protection_alloca_probe_range)\n6546: \n6547: \n6548: /* Functions specific to the C family of frontends.  */\n6549: #undef HOOK_PREFIX\n6550: #define HOOK_PREFIX \"TARGET_C_\"\n6551: HOOK_VECTOR (TARGET_C, c)\n6552: \n6553: /* ??? Documenting this hook requires a GFDL license grant.  */\n6554: DEFHOOK_UNDOC\n6555: (mode_for_suffix,\n6556: \"Return machine mode for non-stand...
151assistantmcp__sourcegraph__sg_keyword_search
152usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
153system-
154system-
155system-
156system-
157system-
158assistantmcp__sourcegraph__sg_read_file
159usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.cc%3FL1-100\n1: /* Subroutines used for code generation on IA-32.\n2:    Copyright (C) 1988-2026 Free Software Foundation, Inc.\n3: \n4: This file is part of GCC.\n5: \n6: GCC is free software; you can redistribute it and/or modify\n7: it under the terms of the GNU General Public License as published by\n8: the Free Software Foundation; either version 3, or (at your option)\n9: any later version.\n10: \n11: GCC is distributed in the hope that it will be useful,\n12: but WITHOUT ANY WARRANTY; without even the implied warranty of\n13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n14: GNU General Public License for more details.\n15: \n16: You should have received a copy of the GNU General Public License\n17: along with GCC; see the file COPYING3.  If not see\n18: <http://www.gnu.org/licenses/>.  */\n19: \n20: #define INCLUDE_STRING\n21: #define IN_TARGET_CODE 1\n22: \n23: #include \"config.h\"\n24: #include \"system.h\"\n25: #include \"coretypes.h\"\n26: #include \"backend.h\"\n27: #include \"rtl.h\"\n28: #include \"tree.h\"\n29: #include \"memmodel.h\"\n30: #include \"gimple.h\"\n31: #include \"cfghooks.h\"\n32: #include \"cfgloop.h\"\n33: #include \"df.h\"\n34: #include \"tm_p.h\"\n35: #include \"stringpool.h\"\n36: #include \"expmed.h\"\n37: #include \"optabs.h\"\n38: #include \"regs.h\"\n39: #include \"emit-rtl.h\"\n40: #include \"recog.h\"\n41: #include \"cgraph.h\"\n42: #include \"diagnostic.h\"\n43: #include \"cfgbuild.h\"\n44: #include \"alias.h\"\n45: #include \"fold-const.h\"\n46: #include \"attribs.h\"\n47: #include \"calls.h\"\n48: #include \"stor-layout.h\"\n49: #include \"varasm.h\"\n50: #include \...
160system-
161system-
162system-
163system-
164system-
165system-
166system-
167system-
168system-
169system-
170system-
171assistantmcp__sourcegraph__sg_keyword_search
172usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n33: extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);\n34: extern void ix86_expand_prologue (void);\n35: extern void ix86_maybe_emit_epilogue_vzeroupper (void);\n36: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n21106:   \"\"\n21107:   \"ix86_expand_prologue (); DONE;\")\n21108: \n21109: \n"}
173system-
174system-
175assistantmcp__sourcegraph__sg_keyword_search
176usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n33: extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);\n34: extern void ix86_expand_prologue (void);\n35: extern void ix86_maybe_emit_epilogue_vzeroupper (void);\n36: \n"}
177system-
178system-
179system-
180system-
181system-
182assistantmcp__sourcegraph__sg_keyword_search
183usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
184assistantmcp__sourcegraph__sg_keyword_search
185usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/rs6000/rs6000-logue.cc\n1553: static rtx_insn *\n1554: rs6000_emit_probe_stack_range_stack_clash (HOST_WIDE_INT orig_size,\n1555: \t\t\t\t\t   rtx copy_reg)\n1556: \n1950: static const char *\n1951: output_probe_stack_range_stack_clash (rtx reg1, rtx reg2, rtx reg3)\n1952: {\n1953: \n1529: static HOST_WIDE_INT\n1530: get_stack_clash_protection_probe_interval (void)\n1531: {\n1532: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/aarch64/aarch64.h\n102:    before probing has to be done for stack clash protection.  */\n103: #define STACK_CLASH_CALLER_GUARD 1024\n104: \n105: \n106:    outgoing arguments to be when stack-clash is enabled.  */\n107: #define STACK_CLASH_MIN_BYTES_OUTGOING_ARGS 8\n108: \n109: \n110:    generating stack clash probes.  */\n111: #define STACK_CLASH_MAX_UNROLL_PAGES 4\n112: \n113: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.h\n1305:    before probing has to be done for stack clash protection.  */\n1306: #define STACK_CLASH_CALLER_GUARD 1024\n1307: \n1308: \n1309:    generating stack clash probes.  */\n1310: #define STACK_CLASH_MAX_UNROLL_PAGES 4\n1311: \n1312: \n1313:    outgoing arguments to be when stack-clash is enabled.  */\n1314: #define STACK_CLASH_MIN_BYTES_OUTGOING_ARGS 8\n1315: \n1316: /* Allocate a minimum of STACK_CLASH_MIN_BYTES_OUTGOING_ARGS bytes for the\n1317:    outgoing arguments if stack clash protection is enabled.  This is essential\n1318: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/loongarch/loongarch.h\n672:    generating stack clash probes.  */\n673: #define STACK_CLASH_MAX_UNROLL_PAGES 4\n674: \n675: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/loongarch/loongarch.cc\n265: /* Size of guard page.  */\n266: #define STACK_CLASH_...
186system-
187system-
188system-
189system-
190system-
191system-
192system-
193assistantmcp__sourcegraph__sg_keyword_search
194usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
195assistantmcp__sourcegraph__sg_keyword_search
196usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
197system-
198system-
199system-
200system-
201system-
202system-
203system-
204system-
205system-
206system-
207system-
208system-
209assistantmcp__sourcegraph__sg_keyword_search
210usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n102: extern const char *output_adjust_stack_and_probe (rtx);\n103: extern const char *output_probe_stack_range (rtx, rtx);\n104: \n105: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n233:   UNSPECV_STACK_PROBE\n234:   UNSPECV_PROBE_STACK_RANGE\n235:   UNSPECV_ALIGN\n236: \n27820: \t(unspec_volatile:P [(match_operand:P 1 \"register_operand\" \"0\")]\n27821: \t\t\t    UNSPECV_PROBE_STACK_RANGE))\n27822:    (set (reg:P SP_REG)\n27823: \n27833: \t\t\t    (match_operand:P 2 \"const_int_operand\")]\n27834: \t\t\t    UNSPECV_PROBE_STACK_RANGE))\n27835:    (clobber (reg:CC FLAGS_REG))]\n27836: \n"}
211assistantmcp__sourcegraph__sg_keyword_search
212usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
213system-
214system-
215system-
216assistantmcp__sourcegraph__sg_keyword_search
217usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
218assistantmcp__sourcegraph__sg_keyword_search
219usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\n102: extern const char *output_adjust_stack_and_probe (rtx);\n103: extern const char *output_probe_stack_range (rtx, rtx);\n104: \n105: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/rs6000/rs6000-logue.cc\n1872: static const char *\n1873: output_probe_stack_range_1 (rtx reg1, rtx reg2)\n1874: {\n1875: \n1986: \n1987: /* Wrapper around the output_probe_stack_range routines.  */\n1988: const char *\n1989: output_probe_stack_range (rtx reg1, rtx reg2, rtx reg3)\n1990: {\n1991: \n1950: static const char *\n1951: output_probe_stack_range_stack_clash (rtx reg1, rtx reg2, rtx reg3)\n1952: {\n1953: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/ia64/ia64-protos.h\n61: extern const char *get_bundle_name (int);\n62: extern const char *output_probe_stack_range (rtx, rtx);\n63: \n64: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/sparc/sparc-protos.h\n80: extern const char *output_v9branch (rtx, rtx, int, int, int, int, rtx_insn *);\n81: extern const char *output_probe_stack_range (rtx, rtx);\n82: extern const char *output_cbcond (rtx, rtx, rtx_insn *);\n83: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/loongarch/loongarch-protos.h\n148: extern const char *loongarch_lsx_output_division (const char *, rtx *);\n149: extern const char *loongarch_output_probe_stack_range (rtx, rtx, rtx);\n150: extern bool loongarch_hard_regno_rename_ok (unsigned int, unsigned int);\n151: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/mips/mips-protos.h\n320: extern const char *mips_msa_output_shift_immediate (const char *, rtx *);\n321: extern const char *mips_output_probe_stack_range (rtx, rtx);\n322: extern bool mips_h...
220system-
221system-
222system-
223system-
224system-
225system-
226system-
227system-
228assistantmcp__sourcegraph__sg_keyword_search
229usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
230assistantmcp__sourcegraph__sg_keyword_search
231usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
232system-
233system-
234assistantmcp__sourcegraph__sg_keyword_search
235usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\n102: extern const char *output_adjust_stack_and_probe (rtx);\n103: extern const char *output_probe_stack_range (rtx, rtx);\n104: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n27826:   \"\"\n27827:   \"* return output_adjust_stack_and_probe (operands[0]);\"\n27828:   [(set_attr \"type\" \"multi\")])\n27829: \n"}
236system-
237system-
238system-
239system-
240system-
241assistantmcp__sourcegraph__sg_read_file
242usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.md%3FL27800-27850\n27800: {\n27801:   emit_insn (gen_probe_stack_1\n27802: \t     (word_mode, operands[0], const0_rtx));\n27803:   DONE;\n27804: })\n27805: \n27806: ;; Use OR for stack probes, this is shorter.\n27807: (define_insn \"@probe_stack_1_<mode>\"\n27808:   [(set (match_operand:W 0 \"memory_operand\" \"=m\")\n27809: \t(unspec:W [(match_operand:W 1 \"const0_operand\")]\n27810: \t\t  UNSPEC_PROBE_STACK))\n27811:    (clobber (reg:CC FLAGS_REG))]\n27812:   \"\"\n27813:   \"or{<imodesuffix>}\\t{%1, %0|%0, %1}\"\n27814:   [(set_attr \"type\" \"alu1\")\n27815:    (set_attr \"mode\" \"<MODE>\")\n27816:    (set_attr \"length_immediate\" \"1\")])\n27817:   \n27818: (define_insn \"@adjust_stack_and_probe_<mode>\"\n27819:   [(set (match_operand:P 0 \"register_operand\" \"=r\")\n27820: \t(unspec_volatile:P [(match_operand:P 1 \"register_operand\" \"0\")]\n27821: \t\t\t    UNSPECV_PROBE_STACK_RANGE))\n27822:    (set (reg:P SP_REG)\n27823:         (minus:P (reg:P SP_REG) (match_operand:P 2 \"const_int_operand\")))\n27824:    (clobber (reg:CC FLAGS_REG))\n27825:    (clobber (mem:BLK (scratch)))]\n27826:   \"\"\n27827:   \"* return output_adjust_stack_and_probe (operands[0]);\"\n27828:   [(set_attr \"type\" \"multi\")])\n27829: \n27830: (define_insn \"@probe_stack_range_<mode>\"\n27831:   [(set (match_operand:P 0 \"register_operand\" \"=r\")\n27832: \t(unspec_volatile:P [(match_operand:P 1 \"register_operand\" \"0\")\n27833: \t\t\t    (match_operand:P 2 \"const_int_operand\")]\n27834: \t\t\t    UNSPECV_PROBE_STACK_RANGE))\n27835:    (clobber (reg:CC FLAGS_REG))]\n27836:   \"\"\n27837:   \"* return output_probe_stack_range (operands[0]...
243system-
244system-
245system-
246system-
247system-
248system-
249system-
250system-
251assistant-
Let me read more of i386.cc to find the stack probe function definitions.
252assistantmcp__sourcegraph__sg_keyword_search
253usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
254system-
255system-
256system-
257system-
258system-
259system-
260system-
261system-
262system-
263assistantmcp__sourcegraph__sg_keyword_search
264usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n96: \n97: extern const char *output_set_got (rtx, rtx);\n98: extern const char *output_387_binary_op (rtx_insn *, rtx*);\n99: extern const char *output_387_reg_move (rtx_insn *, rtx*);\n100: extern const char *output_fix_trunc (rtx_insn *, rtx*, bool);\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\n102: extern const char *output_adjust_stack_and_probe (rtx);\n103: extern const char *output_probe_stack_range (rtx, rtx);\n104: \n105: \n320: /* In winnt.cc  */\n321: extern void i386_pe_record_external_function (tree, const char *);\n322: extern bool i386_pe_binds_local_p (const_tree);\n323: extern const char *i386_pe_strip_name_encoding_full (const char *);\n324: extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree,\n325: \t\t\t\t\t\t    const char *,\n326: \t\t\t\t\t\t    HOST_WIDE_INT,\n327: \n201: extern bool ix86_function_arg_regno_p (int);\n202: extern void ix86_asm_output_function_label (FILE *, const char *, tree);\n203: extern void ix86_asm_output_labelref (FILE *, const char *, const char *);\n204: extern void ix86_call_abi_override (const_tree);\n205: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n3165:   char buf[128];\n3166:   const char *ops;\n3167:   const char *suffix;\n3168: \n3169: \n29664: {\n29665:   static const char * const patterns[4] = {\n29666:    \"prefetchnta\\t%a0\", \"prefetcht2\\t%a0\", \"prefetcht1\\t%a0\", \"prefetcht0\\t%a0\"\n29667: \n29701: {\n29702:   static const char * const patterns[2] = {\n29703:     \"prefetchit1\\t%a0\", \"prefetchit0\\t%a0\"\n29704: \n"}
265system-
266system-
267system-
268system-
269system-
270system-
271assistantmcp__sourcegraph__sg_keyword_search
272usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n27826:   \"\"\n27827:   \"* return output_adjust_stack_and_probe (operands[0]);\"\n27828:   [(set_attr \"type\" \"multi\")])\n27829: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\n102: extern const char *output_adjust_stack_and_probe (rtx);\n103: extern const char *output_probe_stack_range (rtx, rtx);\n104: \n"}
273system-
274system-
275system-
276system-
277system-
278system-
279system-
280system-
281system-
282system-
283system-
284assistant-
Let me read i386.cc in sections to find where the stack probe functions are defined.
285assistantmcp__sourcegraph__sg_read_file
286usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.cc%3FL1-50\n1: /* Subroutines used for code generation on IA-32.\n2:    Copyright (C) 1988-2026 Free Software Foundation, Inc.\n3: \n4: This file is part of GCC.\n5: \n6: GCC is free software; you can redistribute it and/or modify\n7: it under the terms of the GNU General Public License as published by\n8: the Free Software Foundation; either version 3, or (at your option)\n9: any later version.\n10: \n11: GCC is distributed in the hope that it will be useful,\n12: but WITHOUT ANY WARRANTY; without even the implied warranty of\n13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n14: GNU General Public License for more details.\n15: \n16: You should have received a copy of the GNU General Public License\n17: along with GCC; see the file COPYING3.  If not see\n18: <http://www.gnu.org/licenses/>.  */\n19: \n20: #define INCLUDE_STRING\n21: #define IN_TARGET_CODE 1\n22: \n23: #include \"config.h\"\n24: #include \"system.h\"\n25: #include \"coretypes.h\"\n26: #include \"backend.h\"\n27: #include \"rtl.h\"\n28: #include \"tree.h\"\n29: #include \"memmodel.h\"\n30: #include \"gimple.h\"\n31: #include \"cfghooks.h\"\n32: #include \"cfgloop.h\"\n33: #include \"df.h\"\n34: #include \"tm_p.h\"\n35: #include \"stringpool.h\"\n36: #include \"expmed.h\"\n37: #include \"optabs.h\"\n38: #include \"regs.h\"\n39: #include \"emit-rtl.h\"\n40: #include \"recog.h\"\n41: #include \"cgraph.h\"\n42: #include \"diagnostic.h\"\n43: #include \"cfgbuild.h\"\n44: #include \"alias.h\"\n45: #include \"fold-const.h\"\n46: #include \"attribs.h\"\n47: #include \"calls.h\"\n48: #include \"stor-layout.h\"\n49: #include \"varasm.h\"\n50: #include \"...
287system-
288system-
289system-
290system-
291system-
292system-
293system-
294system-
295system-
296system-
297assistantToolSearch
298userToolSearch
{"matches": ["mcp__sourcegraph__sg_go_to_definition"], "query": "select:mcp__sourcegraph__sg_go_to_definition", "total_deferred_tools": 33}
299system-
300system-
301system-
302assistantmcp__sourcegraph__sg_go_to_definition
303assistantmcp__sourcegraph__sg_go_to_definition
304usermcp__sourcegraph__sg_go_to_definition
{"text":"No results.\n\nno definition found for symbol 'output_adjust_stack_and_probe'."}
305usermcp__sourcegraph__sg_go_to_definition
{"text":"No results.\n\nno definition found for symbol 'output_probe_stack_range'."}
306system-
307system-
308system-
309system-
310system-
311system-
312system-
313system-
314system-
315system-
316system-
317system-
318system-
319system-
320system-
321system-
322system-
323system-
324system-
325system-
326system-
327system-
328system-
329system-
330assistant-
Let me search for the `TARGET_STACK_CLASH_PROTECTION` header declaration and also read explow.h.
331assistantmcp__sourcegraph__sg_read_file
332usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/explow.h\n1: /* Export function prototypes from explow.cc.\n2:    Copyright (C) 2015-2026 Free Software Foundation, Inc.\n3: \n4: This file is part of GCC.\n5: \n6: GCC is free software; you can redistribute it and/or modify it under\n7: the terms of the GNU General Public License as published by the Free\n8: Software Foundation; either version 3, or (at your option) any later\n9: version.\n10: \n11: GCC is distributed in the hope that it will be useful, but WITHOUT ANY\n12: WARRANTY; without even the implied warranty of MERCHANTABILITY or\n13: FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\n14: for more details.\n15: \n16: You should have received a copy of the GNU General Public License\n17: along with GCC; see the file COPYING3.  If not see\n18: <http://www.gnu.org/licenses/>.  */\n19: \n20: #ifndef GCC_EXPLOW_H\n21: #define GCC_EXPLOW_H\n22: \n23: /* Return a memory reference like MEMREF, but which is known to have a\n24:    valid address.  */\n25: extern rtx validize_mem (rtx);\n26: \n27: extern rtx use_anchored_address (rtx);\n28: \n29: /* Copy given rtx to a new temp reg and return that.  */\n30: extern rtx copy_to_reg (rtx);\n31: \n32: /* Like copy_to_reg but always make the reg Pmode.  */\n33: extern rtx copy_addr_to_reg (rtx);\n34: \n35: /* Like copy_to_reg but always make the reg the specified mode MODE.  */\n36: extern rtx copy_to_mode_reg (machine_mode, rtx);\n37: \n38: /* Copy given rtx to given temp reg and return that.  */\n39: extern rtx copy_to_suggested_reg (rtx, rtx, machine_mode);\n40: \n41: /* Copy a value to a register if it isn't already a register.\n42:    Args are mode (in case value is a consta...
333assistantmcp__sourcegraph__sg_keyword_search
334usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/explow.h\n77:    many.  Add additional probes to prevent stack clashing attacks.  */\n78: extern void anti_adjust_stack_and_probe_stack_clash (rtx);\n79: \n80: \n81:    protection of dyamically allocated stack space.  */\n82: extern void compute_stack_clash_protection_loop_data (rtx *, rtx *, rtx *,\n83: \t\t\t\t\t\t      HOST_WIDE_INT *, rtx);\n84: extern void emit_stack_clash_protection_probe_loop_start (rtx *, rtx *,\n85: \t\t\t\t\t\t\t  rtx, bool);\n86: extern void emit_stack_clash_protection_probe_loop_end (rtx, rtx,\n87: \t\t\t\t\t\t\trtx, bool);\n88: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/aarch64/aarch64.h\n102:    before probing has to be done for stack clash protection.  */\n103: #define STACK_CLASH_CALLER_GUARD 1024\n104: \n105: \n110:    generating stack clash probes.  */\n111: #define STACK_CLASH_MAX_UNROLL_PAGES 4\n112: \n113: \n106:    outgoing arguments to be when stack-clash is enabled.  */\n107: #define STACK_CLASH_MIN_BYTES_OUTGOING_ARGS 8\n108: \n109: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/sve/pcs/stack_clash_3.c\n\n# github.com/sg-evals/gcc--96dfb333 – gcc/function.h\n639: \n640: enum stack_clash_probes {\n641:   NO_PROBE_NO_FRAME,\n642: \n646: \n647: extern void dump_stack_clash_frame_info (enum stack_clash_probes, bool);\n648: \f\n649: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.h\n1305:    before probing has to be done for stack clash protection.  */\n1306: #define STACK_CLASH_CALLER_GUARD 1024\n1307: \n1308: \n1309:    generating stack clash probes.  */\n1310: #define STACK_CLASH_MAX_UNROLL_PAGES 4\n1311: \n1312: \n1313:    outgoing arguments to be when stack-clash is enabled.  */\n1314: #define STACK_CLASH_MIN_BYTES_OUTGOING_...
335system-
336system-
337system-
338system-
339system-
340system-
341system-
342system-
343system-
344system-
345assistant-
Now let me search for the header where `TARGET_STACK_CLASH_PROTECTION` is declared.
346assistantmcp__sourcegraph__sg_keyword_search
347usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\n16849:   riscv_stack_clash_protection_alloca_probe_range\n16850: \n"}
348assistantmcp__sourcegraph__sg_keyword_search
349usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
350system-
351system-
352system-
353assistantmcp__sourcegraph__sg_keyword_search
354usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
355system-
356system-
357system-
358assistantmcp__sourcegraph__sg_keyword_search
359usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
360assistantmcp__sourcegraph__sg_keyword_search
361usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
362system-
363system-
364system-
365assistantmcp__sourcegraph__sg_read_file
366usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/targhooks.h%3FL295-310\n295: \t\t\t\t       optimization_type);\n296: extern unsigned int default_max_noce_ifcvt_seq_cost (edge);\n297: extern bool default_noce_conversion_profitable_p (rtx_insn *,\n298: \t\t\t\t\t\t  struct noce_if_info *);\n299: extern unsigned int default_min_arithmetic_precision (void);\n300: \n301: extern enum flt_eval_method\n302: default_excess_precision (enum excess_precision_type ATTRIBUTE_UNUSED);\n303: extern bool default_bitint_type_info (int, struct bitint_info *);\n304: extern machine_mode default_mode_for_floating_type (enum tree_index);\n305: extern HOST_WIDE_INT default_stack_clash_protection_alloca_probe_range (void);\n306: extern void default_select_early_remat_modes (sbitmap);\n307: extern tree default_preferred_else_value (unsigned, tree, unsigned, tree *);\n308: extern bool default_instruction_selection (function *, gimple_stmt_iterator *);\n309: extern bool default_have_speculation_safe_value (bool);\n310: extern bool speculation_safe_value_not_needed (bool);\n311: "}
367assistantmcp__sourcegraph__sg_read_file
368usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/targhooks.cc%3FL2740-2760\n2740: {\n2741:   return false;\n2742: }\n2743: \n2744: /* Default implementation for\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\n2746: HOST_WIDE_INT\n2747: default_stack_clash_protection_alloca_probe_range (void)\n2748: {\n2749:   return 0;\n2750: }\n2751: \n2752: /* The default implementation of TARGET_EARLY_REMAT_MODES.  */\n2753: \n2754: void\n2755: default_select_early_remat_modes (sbitmap)\n2756: {\n2757: }\n2758: \n2759: /* The default implementation of TARGET_PREFERRED_ELSE_VALUE.  */\n2760: \n2761: "}
369system-
370system-
371system-
372system-
373system-
374system-
375system-
376system-
377system-
378system-
379system-
380system-
381system-
382system-
383system-
384system-
385system-
386assistantmcp__sourcegraph__sg_keyword_search
387assistantmcp__sourcegraph__sg_keyword_search
388usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/lib/target-supports.exp\n13633: #\n13634: proc check_effective_target_supports_stack_clash_protection { } {\n13635: \n13636: \n"}
389usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/g++.dg/torture/pr82823.C\n2: // { dg-additional-options \"-fstack-clash-protection\" }\n3: // { dg-require-effective-target supports_stack_clash_protection }\n4: \n5: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/g++.dg/torture/pr119610.C\n2: // { dg-additional-options \"-fstack-protector-strong\" { target fstack_protector } }\n3: // { dg-additional-options \"-fstack-clash-protection\" { target supports_stack_clash_protection } }\n4: \n5: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-alloca-2.c\n2: /* { dg-options \"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\" } */\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\n4: \n5: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/g++.target/aarch64/sve/pr119610-sve.C\n2: // { dg-additional-options \"-fstack-protector-strong\" { target fstack_protector } }\n3: // { dg-additional-options \"-fstack-clash-protection\" { target supports_stack_clash_protection } }\n4: \n5: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-prologue-1.c\n2: /* { dg-options \"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\" } */\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\n4: \n5: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-prologue-2.c\n2: /* { dg-options \"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\" } */\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\n4: \n5: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-alloca-3.c\n2: /* { dg-options \"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\" } */\n3: /* { dg-req...
390system-
391system-
392system-
393system-
394system-
395system-
396system-
397system-
398system-
399system-
400system-
401assistantmcp__sourcegraph__sg_keyword_search
402assistantmcp__sourcegraph__sg_keyword_search
403usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
404usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
405system-
406system-
407system-
408system-
409system-
410system-
411system-
412system-
413system-
414system-
415system-
416system-
417system-
418system-
419system-
420system-
421system-
422system-
423assistantmcp__sourcegraph__sg_keyword_search
424usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\n16846: \n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\n16849:   riscv_stack_clash_protection_alloca_probe_range\n16850: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.cc\n2744: /* Default implementation for\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\n2746: HOST_WIDE_INT\n2747: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi\n3771: \n3772: @deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void)\n3773: Some targets have an ABI defined interval for which no probing needs to be done.\n3774: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi.in\n2997: \n2998: @hook TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n2999: \n3000: \n"}
425system-
426system-
427system-
428system-
429system-
430system-
431system-
432system-
433system-
434system-
435system-
436assistant-
Let me read the relevant sections of function.h for stack clash content.
437assistantmcp__sourcegraph__sg_read_file
438usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/function.h%3FL635-655\n635:    to this function will have that bit clear.  */\n636: #define MINIMUM_METHOD_BOUNDARY \\\n637:   ((TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn)\t     \\\n638:    ? MAX (FUNCTION_BOUNDARY, 2 * BITS_PER_UNIT) : FUNCTION_BOUNDARY)\n639: \n640: enum stack_clash_probes {\n641:   NO_PROBE_NO_FRAME,\n642:   NO_PROBE_SMALL_FRAME,\n643:   PROBE_INLINE,\n644:   PROBE_LOOP\n645: };\n646: \n647: extern void dump_stack_clash_frame_info (enum stack_clash_probes, bool);\n648: \f\n649: \n650: extern void push_function_context (void);\n651: extern void pop_function_context (void);\n652: \n653: /* Save and restore status information for a nested function.  */\n654: extern void free_after_parsing (struct function *);\n655: extern void free_after_compilation (struct function *);\n656: "}
439assistantmcp__sourcegraph__sg_read_file
440usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/target.def%3FL1-50\n1: /* Target hook definitions.\n2:    Copyright (C) 2001-2026 Free Software Foundation, Inc.\n3: \n4:    This program is free software; you can redistribute it and/or modify it\n5:    under the terms of the GNU General Public License as published by the\n6:    Free Software Foundation; either version 3, or (at your option) any\n7:    later version.\n8: \n9:    This program is distributed in the hope that it will be useful,\n10:    but WITHOUT ANY WARRANTY; without even the implied warranty of\n11:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n12:    GNU General Public License for more details.\n13: \n14:    You should have received a copy of the GNU General Public License\n15:    along with this program; see the file COPYING3.  If not see\n16:    <http://www.gnu.org/licenses/>.\n17: \n18:    In other words, you are welcome to use, share and improve this program.\n19:    You are forbidden to forbid anyone else to use, share and improve\n20:    what you give them.   Help stamp out software-hoarding!  */\n21: \n22: /* See target-hooks-macros.h for details of macros that should be\n23:    provided by the including file, and how to use them here.  */\n24: #include \"target-hooks-macros.h\"\n25: \n26: #undef HOOK_TYPE\n27: #define HOOK_TYPE \"Target Hook\"\n28: \n29: HOOK_VECTOR (TARGET_INITIALIZER, gcc_target)\n30: \n31: /* Functions that output assembler for the target.  */\n32: #define HOOK_PREFIX \"TARGET_ASM_\"\n33: HOOK_VECTOR (TARGET_ASM_OUT, asm_out)\n34: \n35: /* Opening and closing parentheses for asm expression grouping.  */\n36: DEFHOOKPOD\n37: (open_paren,\n38:  \"These target hooks are C string c...
441system-
442system-
443system-
444system-
445system-
446system-
447system-
448system-
449system-
450system-
451system-
452system-
453system-
454system-
455system-
456system-
457system-
458system-
459system-
460assistant-
Let me read different sections of i386.cc to find the stack probe implementation.
461assistantmcp__sourcegraph__sg_read_file
462usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.cc%3FL100-200\n100: #include \"i386-features.h\"\n101: #include \"function-abi.h\"\n102: #include \"rtl-error.h\"\n103: #include \"gimple-pretty-print.h\"\n104: \n105: /* This file should be included last.  */\n106: #include \"target-def.h\"\n107: \n108: static void ix86_print_operand_address_as (FILE *, rtx, addr_space_t, bool);\n109: static void ix86_emit_restore_reg_using_pop (rtx, bool = false);\n110: \n111: \n112: #ifndef CHECK_STACK_LIMIT\n113: #define CHECK_STACK_LIMIT (-1)\n114: #endif\n115: \n116: /* Return index of given mode in mult and division cost tables.  */\n117: #define MODE_INDEX(mode)\t\t\t\t\t\\\n118:   ((mode) == QImode ? 0\t\t\t\t\t\t\\\n119:    : (mode) == HImode ? 1\t\t\t\t\t\\\n120:    : (mode) == SImode ? 2\t\t\t\t\t\\\n121:    : (mode) == DImode ? 3\t\t\t\t\t\\\n122:    : 4)\n123: \n124: \n125: /* Set by -mtune.  */\n126: const struct processor_costs *ix86_tune_cost = NULL;\n127: \n128: /* Set by -mtune or -Os.  */\n129: const struct processor_costs *ix86_cost = NULL;\n130: \n131: /* In case the average insn count for single function invocation is\n132:    lower than this constant, emit fast (but longer) prologue and\n133:    epilogue code.  */\n134: #define FAST_PROLOGUE_INSN_COUNT 20\n135: \n136: /* Names for 8 (low), 8 (high), and 16-bit registers, respectively.  */\n137: static const char *const qi_reg_name[] = QI_REGISTER_NAMES;\n138: static const char *const qi_high_reg_name[] = QI_HIGH_REGISTER_NAMES;\n139: static const char *const hi_reg_name[] = HI_REGISTER_NAMES;\n140: \n141: /* Array of the smallest class containing reg number REGNO, indexed by\n142:    REGNO.  Used by REGNO_REG_CLASS in i...
463system-
464system-
465system-
466system-
467system-
468system-
469system-
470system-
471system-
472system-
473system-
474system-
475system-
476assistantmcp__sourcegraph__sg_read_file
477usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386-expand.cc%3FL1-80\n1: /* Copyright (C) 1988-2026 Free Software Foundation, Inc.\n2: \n3: This file is part of GCC.\n4: \n5: GCC is free software; you can redistribute it and/or modify\n6: it under the terms of the GNU General Public License as published by\n7: the Free Software Foundation; either version 3, or (at your option)\n8: any later version.\n9: \n10: GCC is distributed in the hope that it will be useful,\n11: but WITHOUT ANY WARRANTY; without even the implied warranty of\n12: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n13: GNU General Public License for more details.\n14: \n15: You should have received a copy of the GNU General Public License\n16: along with GCC; see the file COPYING3.  If not see\n17: <http://www.gnu.org/licenses/>.  */\n18: \n19: #define IN_TARGET_CODE 1\n20: \n21: #include \"config.h\"\n22: #include \"system.h\"\n23: #include \"coretypes.h\"\n24: #include \"backend.h\"\n25: #include \"rtl.h\"\n26: #include \"tree.h\"\n27: #include \"memmodel.h\"\n28: #include \"gimple.h\"\n29: #include \"cfghooks.h\"\n30: #include \"cfgloop.h\"\n31: #include \"df.h\"\n32: #include \"tm_p.h\"\n33: #include \"stringpool.h\"\n34: #include \"expmed.h\"\n35: #include \"optabs.h\"\n36: #include \"regs.h\"\n37: #include \"emit-rtl.h\"\n38: #include \"recog.h\"\n39: #include \"cgraph.h\"\n40: #include \"diagnostic.h\"\n41: #include \"cfgbuild.h\"\n42: #include \"alias.h\"\n43: #include \"fold-const.h\"\n44: #include \"attribs.h\"\n45: #include \"calls.h\"\n46: #include \"stor-layout.h\"\n47: #include \"varasm.h\"\n48: #include \"output.h\"\n49: #include \"insn-attr.h\"\n50: #include \"flags.h\"\n51: #inc...
478system-
479system-
480system-
481system-
482system-
483system-
484system-
485system-
486system-
487system-
488system-
489system-
490system-
491system-
492system-
493system-
494system-
495system-
496system-
497system-
498system-
499system-
500system-
501system-
502system-
503system-
504system-
505system-
506assistant-
Let me check a few more potential locations for `TARGET_STACK_CLASH_PROTECTION`.
507assistantmcp__sourcegraph__sg_keyword_search
508usermcp__sourcegraph__sg_keyword_search
{"text":"No results.\n\nNo results found."}
509assistantmcp__sourcegraph__sg_keyword_search
510usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/params.opt\n1108: -param=stack-clash-protection-guard-size=\n1109: Common Joined UInteger Var(param_stack_clash_protection_guard_size) Init(12) IntegerRange(12, 30) Param Optimization\n1110: Size of the stack guard expressed as a power of two in bytes.\n1111: \n1112: -param=stack-clash-protection-probe-interval=\n1113: Common Joined UInteger Var(param_stack_clash_protection_probe_interval) Init(12) IntegerRange(10, 16) Param Optimization\n1114: Interval in which to probe the stack expressed as a power of two in bytes.\n1115: \n"}
511system-
512system-
513system-
514system-
515system-
516system-
517system-
518system-
519system-
520system-
521system-
522system-
523system-
524system-
525system-
526system-
527system-
528system-
529system-
530system-
531system-
532system-
533system-
534system-
535system-
536system-
537system-
538system-
539system-
540system-
541system-
542assistant-
Let me look for all stack-clash test files and verify the explow.cc function list.
543assistantmcp__sourcegraph__sg_keyword_search
544assistantmcp__sourcegraph__sg_read_file
545usermcp__sourcegraph__sg_read_file
{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/explow.cc%3FL1920-2000\n1920: \n1921: \t  if (CONST_INT_P (temp))\n1922: \t    {\n1923: \t      /* Use [base + disp} addressing mode if supported.  */\n1924: \t      HOST_WIDE_INT offset = INTVAL (temp);\n1925: \t      addr = memory_address (Pmode,\n1926: \t\t\t\t     plus_constant (Pmode, last_addr,\n1927: \t\t\t\t\t\t    STACK_GROW_OFF (offset)));\n1928: \t    }\n1929: \t  else\n1930: \t    {\n1931: \t      /* Manual CSE if the difference is not known at compile-time.  */\n1932: \t      temp = gen_rtx_MINUS (Pmode, size, rounded_size_op);\n1933: \t      addr = memory_address (Pmode,\n1934: \t\t\t\t     gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,\n1935: \t\t\t\t\t\t     last_addr, temp));\n1936: \t    }\n1937: \n1938: \t  emit_stack_probe (addr);\n1939: \t}\n1940:     }\n1941: \n1942:   /* Make sure nothing is scheduled before we are done.  */\n1943:   emit_insn (gen_blockage ());\n1944: }\n1945: \n1946: /* Compute parameters for stack clash probing a dynamic stack\n1947:    allocation of SIZE bytes.\n1948: \n1949:    We compute ROUNDED_SIZE, LAST_ADDR, RESIDUAL and PROBE_INTERVAL.\n1950: \n1951:    Additionally we conditionally dump the type of probing that will\n1952:    be needed given the values computed.  */\n1953: \n1954: void\n1955: compute_stack_clash_protection_loop_data (rtx *rounded_size, rtx *last_addr,\n1956: \t\t\t\t\t  rtx *residual,\n1957: \t\t\t\t\t  HOST_WIDE_INT *probe_interval,\n1958: \t\t\t\t\t  rtx size)\n1959: {\n1960:   /* Round SIZE down to STACK_CLASH_PROTECTION_PROBE_INTERVAL */\n1961:   *probe_interval\n1962:     = 1 << param_stack_clash_protection_probe_interval;\n1963:   *rounded_size = simplify_gen_binary (AND, Pmode,...
546usermcp__sourcegraph__sg_keyword_search
{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-clash-protection.c\n"}
547system-
548system-
549system-
550system-
551system-
552system-
553system-
554system-
555system-
556system-
557system-
558system-
559system-
560system-
561system-
562system-
563system-
564system-
565system-
566system-
567assistant-
I have gathered enough information. Now let me write the answer.json.
568assistantWrite
569userWrite
File created successfully at: /workspace/answer.json (file state is current in your context — no need to Read it back)
570assistant-
The audit is complete. Here's a summary of findings:

## GCC Stack Clash Protection Audit

| # | File | Key Symbol |
|---|------|-----------|
| 1 | `gcc/config/i386/i386.cc` | `output_adjust_stack_and_probe`, `output_probe_stack_range` |
| 2 | `gcc/explow.cc` | `anti_adjust_stack_and_probe` (line 2200), `anti_adjust_stack_and_probe_stack_clash` (line 2072), `compute_stack_clash_protection_loop_data` (line 1954) |
| 3 | `gcc/target.def` | `DEFHOOK(stack_clash_protection_alloca_probe_range, ...)` → `TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE` |
| 3b | `gcc/explow.h` | Stack clash function declarations |
| 3c | `gcc/targhooks.h` | `default_stack_clash_protection_alloca_probe_range` |
| 4 | `gcc/testsuite/gcc.target/i386/stack-clash-protection.c` | compile test with `-fstack-clash-protection` |
| 5 | `gcc/common.opt` (line 3054) | `fstack-clash-protection` → `flag_stack_clash_protection` |

**Key design notes:**
- The `-fstack-clash-protection` flag is processed via `flag_stack_clash_protection` from `common.opt`
- The generic implementation in `explow.cc` handles all architectures; targets can customize via the `TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE` hook
- For x86, `output_adjust_stack_and_probe` in `i386.cc` generates the actual probe-and-decrement loop assembly
- `function.h`'s `stack_clash_probes` enum tracks whether frame probing is inline, loop-based, or not needed
Tool calls (76)
1. ToolSearch

Input

{
  "query": "select:mcp__sourcegraph__sg_keyword_search,mcp__sourcegraph__sg_read_file,mcp__sourcegraph__sg_list_files",
  "max_results": 5
}

Output

{'matches': ['mcp__sourcegraph__sg_keyword_search', 'mcp__sourcegraph__sg_read_file', 'mcp__sourcegraph__sg_list_files'], 'query': 'select:mcp__sourcegraph__sg_keyword_search,mcp__sourcegraph__sg_read_file,mcp__sourcegraph__sg_list_files', 'total_deferred_tools': 33}
2. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ stack_clash_protection file:i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
3. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ anti_adjust_stack_and_probe file:explow.cc"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/explow.cc\\n2200: void\\n2201: anti_adjust_stack_and_probe (rtx size, bool adjust_back)\\n2202: {\\n2203: \\n2071: void\\n2072: anti_adjust_stack_and_probe_stack_clash (rtx size)\\n2073: {\\n2074: \\n1643:       if (flag_stack_check && STACK_CHECK_MOVING_SP)\\n1644: \\tanti_adjust_stack_and_probe (size, false);\\n1645:       else if (flag_stack_clash_protection)\\n1646: \\tanti_adjust_stack_and_probe_stack_clash (size);\\n1647:       else\\n1648: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/explow.cc\n2200: void\n2201: anti_adjust_stack_and_probe (rtx size, bool adjust_back)\n2202: {\n2203: \n2071: void\n2072: anti_adjust_stack_and_probe_stack_clash (rtx size)\n2073: {\n2074: \n1643:       if (flag_stack_check && STACK_CHECK_MOVING_SP)\n1644: \tanti_adjust_stack_and_probe (size, false);\n1645:       else if (flag_stack_clash_protection)\n1646: \tanti_adjust_stack_and_probe_stack_clash (size);\n1647:       else\n1648: \n'}}
4. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ TARGET_STACK_CLASH_PROTECTION"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\\n16846: \\n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\\\\n16849:   riscv_stack_clash_protection_alloca_probe_range\\n16850: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.cc\\n2744: /* Default implementation for\\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\\n2746: HOST_WIDE_INT\\n2747: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi\\n3771: \\n3772: @deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void)\\n3773: Some targets have an ABI defined interval for which no probing needs to be done.\\n3774: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi.in\\n2997: \\n2998: @hook TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\\n2999: \\n3000: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\n16846: \n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\n16849:   riscv_stack_clash_protection_alloca_probe_range\n16850: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.cc\n2744: /* Default implementation for\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\n2746: HOST_WIDE_INT\n2747: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi\n3771: \n3772: @deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void)\n3773: Some targets have an ABI defined interval for which no probing needs to be done.\n3774: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi.in\n2997: \n2998: @hook TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n2999: \n3000: \n'}}
5. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ stack-clash file:testsuite/gcc.target/i386"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr109780-3.c\\n1: /* { dg-do run  { target avx2_runtime } }  */\\n2: /* { dg-options \\"-O2 -mavx2 -mtune=znver1 -fno-stack-protector -fno-stack-clash-protection\\" } */\\n3: \\n4: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-clash-protection.c\\n1: /* { dg-do compile } */\\n2: /* { dg-options \\"-O2 -fstack-clash-protection\\" } */\\n3: \\n4: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr84128.c\\n1: /* { dg-do run } */\\n2: /* { dg-options \\"-O2 -march=i686 -mtune=generic -fstack-clash-protection\\" } */\\n3: /* { dg-require-effective-target ia32 } */\\n4: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr83994.c\\n2: /* { dg-require-effective-target fpic } */\\n3: /* { dg-options \\"-O2 -march=i686 -fpic -fstack-clash-protection\\" } */\\n4: /* { dg-require-effective-target ia32 } */\\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr84064.c\\n1: /* { dg-do compile } */\\n2: /* { dg-options \\"-O2 -march=i686 -fstack-clash-protection\\" } */\\n3: /* { dg-require-effective-target ia32 } */\\n4: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-check-17.c\\n1: /* { dg-do compile } */\\n2: /* { dg-options \\"-O2 -fstack-clash-protection -mtune=generic -fomit-frame-pointer -mnoreturn-no-callee-saved-registers\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-check-11.c\\n1: /* { dg-do compile } */\\n2: /* { dg-options \\"-O2 -fstack-clash-protection -mtune=generic -fno-stack-protector\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-check-12.c\\n1: /* { dg-do compile } */\\n2: /* { dg-options \\"-O2 -fstack-clash-protection -mtune=generic -fomit-frame-pointer\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-check-18.c\\n1: /* { dg-do compile } */\\n2: /* { dg-options \\"-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand -fno-stack-protector\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-check-19.c\\n1: /* { dg-do compile } */\\n2: /* { dg-options \\"-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand -fno-stack-protector\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr109780-3.c\n1: /* { dg-do run  { target avx2_runtime } }  */\n2: /* { dg-options "-O2 -mavx2 -mtune=znver1 -fno-stack-protector -fno-stack-clash-protection" } */\n3: \n4: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-clash-protection.c\n1: /* { dg-do compile } */\n2: /* { dg-options "-O2 -fstack-clash-protection" } */\n3: \n4: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr84128.c\n1: /* { dg-do run } */\n2: /* { dg-options "-O2 -march=i686 -mtune=generic -fstack-clash-protection" } */\n3: /* { dg-require-effective-target ia32 } */\n4: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr83994.c\n2: /* { dg-require-effective-target fpic } */\n3: /* { dg-options "-O2 -march=i686 -fpic -fstack-clash-protection" } */\n4: /* { dg-require-effective-target ia32 } */\n5: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/pr84064.c\n1: /* { dg-do compile } */\n2: /* { dg-options "-O2 -march=i686 -fstack-clash-protection" } */\n3: /* { dg-require-effective-target ia32 } */\n4: \n\n# github.com/sg-evals...
6. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ fstack-clash-protection file:common.opt"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/common.opt\\n3053: \\n3054: fstack-clash-protection\\n3055: Common Var(flag_stack_clash_protection) Optimization\\n3056: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/common.opt.urls\\n1453: \\n1454: fstack-clash-protection\\n1455: UrlSuffix(gcc/Instrumentation-Options.html#index-fno-stack-clash-protection)\\n1456: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/common.opt\n3053: \n3054: fstack-clash-protection\n3055: Common Var(flag_stack_clash_protection) Optimization\n3056: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/common.opt.urls\n1453: \n1454: fstack-clash-protection\n1455: UrlSuffix(gcc/Instrumentation-Options.html#index-fno-stack-clash-protection)\n1456: \n'}}
7. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ stack_clash file:config/i386/i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
8. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ TARGET_STACK_CLASH_PROTECTION file:target.def"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
9. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ stack-clash-protection file:testsuite/gcc.target/i386/stack-clash"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-clash-protection.c\\n1: /* { dg-do compile } */\\n2: /* { dg-options \\"-O2 -fstack-clash-protection\\" } */\\n3: \\n4: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-clash-protection.c\n1: /* { dg-do compile } */\n2: /* { dg-options "-O2 -fstack-clash-protection" } */\n3: \n4: \n'}}
10. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ ix86_adjust_stack_and_probe file:i386"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
11. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ TARGET_STACK_CLASH_PROTECTION file:.h"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.cc\\n2744: /* Default implementation for\\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\\n2746: HOST_WIDE_INT\\n2747: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.cc\n2744: /* Default implementation for\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\n2746: HOST_WIDE_INT\n2747: \n'}}
12. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE file:targhooks.h"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.h\\n304: extern machine_mode default_mode_for_floating_type (enum tree_index);\\n305: extern HOST_WIDE_INT default_stack_clash_protection_alloca_probe_range (void);\\n306: extern void default_select_early_remat_modes (sbitmap);\\n307: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.h\n304: extern machine_mode default_mode_for_floating_type (enum tree_index);\n305: extern HOST_WIDE_INT default_stack_clash_protection_alloca_probe_range (void);\n306: extern void default_select_early_remat_modes (sbitmap);\n307: \n'}}
13. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ probe_stack_clash file:i386"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
14. mcp__sourcegraph__sg_list_files

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/config/i386"
}

Output

{'content': '{"text":"gcc/config/i386/adxintrin.h\\ngcc/config/i386/ammintrin.h\\ngcc/config/i386/amxavx512intrin.h\\ngcc/config/i386/amxbf16intrin.h\\ngcc/config/i386/amxcomplexintrin.h\\ngcc/config/i386/amxfp16intrin.h\\ngcc/config/i386/amxfp8intrin.h\\ngcc/config/i386/amxint8intrin.h\\ngcc/config/i386/amxmovrsintrin.h\\ngcc/config/i386/amxtf32intrin.h\\ngcc/config/i386/amxtileintrin.h\\ngcc/config/i386/amxtransposeintrin.h\\ngcc/config/i386/athlon.md\\ngcc/config/i386/atom.md\\ngcc/config/i386/att.h\\ngcc/config/i386/avx10_2bf16intrin.h\\ngcc/config/i386/avx10_2convertintrin.h\\ngcc/config/i386/avx10_2copyintrin.h\\ngcc/config/i386/avx10_2mediaintrin.h\\ngcc/config/i386/avx10_2minmaxintrin.h\\ngcc/config/i386/avx10_2satcvtintrin.h\\ngcc/config/i386/avx2intrin.h\\ngcc/config/i386/avx5124fmapsintrin.h\\ngcc/config/i386/avx5124vnniwintrin.h\\ngcc/config/i386/avx512bf16intrin.h\\ngcc/config/i386/avx512bf16vlintrin.h\\ngcc/config/i386/avx512bitalgintrin.h\\ngcc/config/i386/avx512bitalgvlintrin.h\\ngcc/config/i386/avx512bmmintrin.h\\ngcc/config/i386/avx512bmmvlintrin.h\\ngcc/config/i386/avx512bwintrin.h\\ngcc/config/i386/avx512cdintrin.h\\ngcc/config/i386/avx512dqintrin.h\\ngcc/config/i386/avx512erintrin.h\\ngcc/config/i386/avx512fintrin.h\\ngcc/config/i386/avx512fp16intrin.h\\ngcc/config/i386/avx512fp16vlintrin.h\\ngcc/config/i386/avx512ifmaintrin.h\\ngcc/config/i386/avx512ifmavlintrin.h\\ngcc/config/i386/avx512pfintrin.h\\ngcc/config/i386/avx512vbmi2intrin.h\\ngcc/config/i386/avx512vbmi2vlintrin.h\\ngcc/config/i386/avx512vbmiintrin.h\\ngcc/config/i386/avx512vbmivlintrin.h\\ngcc/config/i386/avx512vlbwintrin.h\\ngcc/config/i386/avx512vldqintrin.h\\ngcc/config/i386/avx512vlintrin.h\\ngcc/config/i386/avx512vnniintrin.h\\ngcc/config/i386/avx512vnnivlintrin.h\\ngcc/config/i386/avx512vp2intersectintrin.h\\ngcc/config/i386/avx512vp2intersectvlintrin.h\\ngcc/config/i386/avx512vpopcntdqintrin.h\\ngcc/config/i386/avx512vpopcntdqvlintrin.h\\ngcc/config/i386/avxifmaintrin.h\\ngcc/config/i386/avxintrin.h\\ngcc/config/i386/avxmath.h\\ngcc/config/i386/avxneconvertintrin.h\\ngcc/config/i386/avxvnniint16intrin.h\\ngcc/config/i386/avxvnniint8intrin.h\\ngcc/config/i386/avxvnniintrin.h\\ngcc/config/i386/bdver1.md\\ngcc/config/i386/bdver3.md\\ngcc/config/i386/biarch64.h\\ngcc/config/i386/biarchx32.h\\ngcc/config/i386/bmi2intrin.h\\ngcc/config/i386/bmiintrin.h\\ngcc/config/i386/bmmintrin.h\\ngcc/config/i386/bsd.h\\ngcc/config/i386/btver2.md\\ngcc/config/i386/cet.h\\ngcc/config/i386/cetintrin.h\\ngcc/config/i386/cldemoteintrin.h\\ngcc/config/i386/clflushoptintrin.h\\ngcc/config/i386/clwbintrin.h\\ngcc/config/i386/clzerointrin.h\\ngcc/config/i386/cmpccxaddintrin.h\\ngcc/config/i386/constraints.md\\ngcc/config/i386/core2.md\\ngcc/config/i386/cpuid.h\\ngcc/config/i386/cross-stdarg.h\\ngcc/config/i386/crtdll.h\\ngcc/config/i386/cygming.h\\ngcc/config/i386/cygwin-stdint.h\\ngcc/config/i386/cygwin-w64.h\\ngcc/config/i386/cygwin.h\\ngcc/config/i386/cygwin.opt\\ngcc/config/i386/cygwin.opt.urls\\ngcc/config/i386/darwin.h\\ngcc/config/i386/darwin32-biarch.h\\ngcc/config/i386/darwin64-biarch.h\\ngcc/config/i386/djgpp-stdint.h\\ngcc/config/i386/djgpp.cc\\ngcc/config/i386/djgpp.h\\ngcc/config/i386/djgpp.opt\\ngcc/config/i386/djgpp.opt.urls\\ngcc/config/i386/dragonfly.h\\ngcc/config/i386/driver-i386.cc\\ngcc/config/i386/driver-mingw32.cc\\ngcc/config/i386/emmintrin.h\\ngcc/config/i386/enqcmdintrin.h\\ngcc/config/i386/f16cintrin.h\\ngcc/config/i386/fma4intrin.h\\ngcc/config/i386/fmaintrin.h\\ngcc/config/i386/freebsd.h\\ngcc/config/i386/freebsd64.h\\ngcc/config/i386/fxsrintrin.h\\ngcc/config/i386/gas.h\\ngcc/config/i386/gcc-auto-profile\\ngcc/config/i386/geode.md\\ngcc/config/i386/gfniintrin.h\\ngcc/config/i386/glm.md\\ngcc/config/i386/gmm_malloc.h\\ngcc/config/i386/gnu-property.cc\\ngcc/config/i386/gnu-user-common.h\\ngcc/config/i386/gnu-user.h\\ngcc/config/i386/gnu-user64.h\\ngcc/config/i386/gnu.h\\ngcc/config/i386/gnu64.h\\ngcc/config/i386/haswell.md\\ngcc/config/...
15. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ stack_clash file:config/i386"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
16. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ stack_clash file:i386-expand.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
17. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ STACK_CLASH_PROTECTION file:target.def"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/target.def\\n6534: DEFHOOK\\n6535: (stack_clash_protection_alloca_probe_range,\\n6536:  \\"Some targets have an ABI defined interval for which no probing needs to be done.\\\\n\\\\\\n6537: \\n6544:  HOST_WIDE_INT, (void),\\n6545:  default_stack_clash_protection_alloca_probe_range)\\n6546: \\n6547: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/target.def\n6534: DEFHOOK\n6535: (stack_clash_protection_alloca_probe_range,\n6536:  "Some targets have an ABI defined interval for which no probing needs to be done.\\n\\\n6537: \n6544:  HOST_WIDE_INT, (void),\n6545:  default_stack_clash_protection_alloca_probe_range)\n6546: \n6547: \n'}}
18. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ flag_stack_clash file:i386"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
19. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ STACK_CLASH_PROTECTION file:i386.h"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
20. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ ix86_expand_prologue file:config/i386"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\\n21106:   \\"\\"\\n21107:   \\"ix86_expand_prologue (); DONE;\\")\\n21108: \\n21109: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\\n33: extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);\\n34: extern void ix86_expand_prologue (void);\\n35: extern void ix86_maybe_emit_epilogue_vzeroupper (void);\\n36: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n21106:   ""\n21107:   "ix86_expand_prologue (); DONE;")\n21108: \n21109: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n33: extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);\n34: extern void ix86_expand_prologue (void);\n35: extern void ix86_maybe_emit_epilogue_vzeroupper (void);\n36: \n'}}
21. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"stack clash\" file:config/i386"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
22. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"ix86_expand_prologue\" file:i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
23. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"ix86_expand_prologue\" file:i386-expand.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
24. mcp__sourcegraph__sg_nls_search

Input

{
  "query": "stack clash protection probing i386 x86_64 expand prologue"
}

Output

{'content': '{"text":"# github.com/microsoft/vscode – src/vs/workbench/contrib/testing/common/testTypes.ts\\n428: \\n429: export const enum TestItemExpandState {\\n430: \\tNotExpandable,\\n431: \\tExpandable,\\n432: \\tBusyExpanding,\\n433: \\tExpanded,\\n434: }\\n435: \\n454: \\texport const serialize = (item: Readonly<InternalTestItem>): Serialized => ({\\n455: \\t\\texpand: item.expand,\\n456: \\t\\titem: ITestItem.serialize(item.item)\\n457: \\n463: \\t\\tcontrollerId: TestId.root(serialized.item.extId),\\n464: \\t\\texpand: serialized.expand,\\n465: \\t\\titem: ITestItem.deserialize(uriIdentity, serialized.item)\\n466: \\n\\n# github.com/kubernetes/kubernetes – cmd/kube-controller-manager/app/core.go\\n320: \\n321: func newPersistentVolumeExpanderControllerDescriptor() *ControllerDescriptor {\\n322: \\treturn &ControllerDescriptor{\\n323: \\t\\tname:        names.PersistentVolumeExpanderController,\\n324: \\t\\taliases:     []string{\\"persistentvolume-expander\\"},\\n325: \\t\\tconstructor: newPersistentVolumeExpanderController,\\n326: \\t}\\n327: \\n737: \\n738: func newPersistentVolumeProtectionControllerDescriptor() *ControllerDescriptor {\\n739: \\treturn &ControllerDescriptor{\\n740: \\t\\tname:        names.PersistentVolumeProtectionController,\\n741: \\t\\taliases:     []string{\\"pv-protection\\"},\\n742: \\t\\tconstructor: newPersistentVolumeProtectionController,\\n743: \\t}\\n744: \\n708: \\n709: func newPersistentVolumeClaimProtectionControllerDescriptor() *ControllerDescriptor {\\n710: \\treturn &ControllerDescriptor{\\n711: \\t\\tname:        names.PersistentVolumeClaimProtectionController,\\n712: \\t\\taliases:     []string{\\"pvc-protection\\"},\\n713: \\t\\tconstructor: newPersistentVolumeClaimProtectionController,\\n714: \\t}\\n715: \\n\\n# github.com/pytorch/pytorch – torch/fx/graph.py\\n332: \\n333: # get File:lineno code from stack_trace\\n334: def _parse_stack_trace(\\n335:     stack_trace: str, filter_fn: Callable[[str, str, str], bool] | None = None\\n336: ) -> _ParsedStackTrace | None:\\n337:     if stack_trace is None:\\n338:         return None\\n339: \\n318: @dataclass(frozen=True)\\n319: class _ParsedStackTrace:\\n320:     \\"\\"\\"\\n321:     Represents the top-most frame of a parsed stack trace\\n322:     \\"\\"\\"\\n323: \\n247:     # Optional mapping from the forward function\'s line number to\\n248:     # node index. Line number starts at the prologue (i.e. forward()).\\n249:     _lineno_map: dict[int, int | None] | None\\n250:     # The line number of prologue in fn_code\\n251:     _prologue_start: int = 0\\n252: \\n253: \\n\\n# github.com/microsoft/vscode – src/vs/workbench/contrib/debug/browser/variablesView.ts\\n336: \\n337: function isStackFrame(obj: any): obj is IStackFrame {\\n338: \\treturn obj instanceof StackFrame;\\n339: }\\n340: \\n67: \\tprivate needsRefresh = false;\\n68: \\tprivate tree!: WorkbenchAsyncDataTree<IStackFrame | null, IExpression | IScope, FuzzyScore>;\\n69: \\tprivate savedViewState = new Map<string, IAsyncDataTreeViewState>();\\n70: \\tprivate autoExpandedScopes = new Set<string>();\\n71: \\n72: \\n353: \\n354: \\tprotected override doGetChildren(element: IStackFrame | IExpression | IScope): Promise<(IExpression | IScope)[]> {\\n355: \\t\\tif (isStackFrame(element)) {\\n356: \\t\\t\\treturn element.getScopes();\\n357: \\n\\n# github.com/microsoft/vscode – src/vs/workbench/contrib/debug/browser/callStackView.ts\\n139: \\n140: async function expandTo(session: IDebugSession, tree: WorkbenchCompressibleAsyncDataTree<IDebugModel, CallStackItem, FuzzyScore>): Promise<void> {\\n141: \\tif (session.parentSession) {\\n142: \\t\\tawait expandTo(session.parentSession, tree);\\n143: \\t}\\n144: \\tawait tree.expand(session);\\n145: }\\n146: \\n514: \\n515: interface IStackFrameTemplateData {\\n516: \\tstackFrame: HTMLElement;\\n517: \\tfile: HTMLElement;\\n518: \\n56: \\n57: type CallStackItem = IStackFrame | IThread | IDebugSession | string | ThreadAndSessionIds | IStac...
25. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"ix86_adjust_stack_and_probe\" OR \"ix86_emit_probe_stack_range\""
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
26. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"stack_clash\" file:explow.cc"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/explow.cc\\n2071: void\\n2072: anti_adjust_stack_and_probe_stack_clash (rtx size)\\n2073: {\\n2074: \\n2013: void\\n2014: emit_stack_clash_protection_probe_loop_start (rtx *loop_lab,\\n2015: \\t\\t\\t\\t\\t      rtx *end_lab,\\n2016: \\n2035: void\\n2036: emit_stack_clash_protection_probe_loop_end (rtx loop_lab, rtx end_loop,\\n2037: \\t\\t\\t\\t\\t    rtx last_addr, bool rotated)\\n2038: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/explow.cc\n2071: void\n2072: anti_adjust_stack_and_probe_stack_clash (rtx size)\n2073: {\n2074: \n2013: void\n2014: emit_stack_clash_protection_probe_loop_start (rtx *loop_lab,\n2015: \t\t\t\t\t      rtx *end_lab,\n2016: \n2035: void\n2036: emit_stack_clash_protection_probe_loop_end (rtx loop_lab, rtx end_loop,\n2037: \t\t\t\t\t    rtx last_addr, bool rotated)\n2038: \n'}}
27. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/explow.cc",
  "startLine": 2000,
  "endLine": 2220
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/explow.cc%3FL2000-2220\\n2000: \\tfprintf (dump_file,\\n2001: \\t\\t \\"Stack clash skipped dynamic allocation and \\"\\n2002: \\t\\t \\"probing residuals.\\\\n\\");\\n2003:     }\\n2004: }\\n2005: \\n2006: /* Emit the start of an allocate/probe loop for stack\\n2007:    clash protection.\\n2008: \\n2009:    LOOP_LAB and END_LAB are returned for use when we emit the\\n2010:    end of the loop.\\n2011: \\n2012:    LAST addr is the value for SP which stops the loop.  */\\n2013: void\\n2014: emit_stack_clash_protection_probe_loop_start (rtx *loop_lab,\\n2015: \\t\\t\\t\\t\\t      rtx *end_lab,\\n2016: \\t\\t\\t\\t\\t      rtx last_addr,\\n2017: \\t\\t\\t\\t\\t      bool rotated)\\n2018: {\\n2019:   /* Essentially we want to emit any setup code, the top of loop\\n2020:      label and the comparison at the top of the loop.  */\\n2021:   *loop_lab = gen_label_rtx ();\\n2022:   *end_lab = gen_label_rtx ();\\n2023: \\n2024:   emit_label (*loop_lab);\\n2025:   if (!rotated)\\n2026:     emit_cmp_and_jump_insns (stack_pointer_rtx, last_addr, EQ, NULL_RTX,\\n2027: \\t\\t\\t     Pmode, 1, *end_lab);\\n2028: }\\n2029: \\n2030: /* Emit the end of a stack clash probing loop.\\n2031: \\n2032:    This consists of just the jump back to LOOP_LAB and\\n2033:    emitting END_LOOP after the loop.  */\\n2034: \\n2035: void\\n2036: emit_stack_clash_protection_probe_loop_end (rtx loop_lab, rtx end_loop,\\n2037: \\t\\t\\t\\t\\t    rtx last_addr, bool rotated)\\n2038: {\\n2039:   if (rotated)\\n2040:     emit_cmp_and_jump_insns (stack_pointer_rtx, last_addr, NE, NULL_RTX,\\n2041: \\t\\t\\t     Pmode, 1, loop_lab);\\n2042:   else\\n2043:     emit_jump (loop_lab);\\n2044: \\n2045:   emit_label (end_loop);\\n2046: \\n2047: }\\n2048: \\n2049: /* Adjust the stack pointer by minus SIZE (an rtx for a number of bytes)\\n2050:    while probing it.  This pushes when SIZE is positive.  SIZE need not\\n2051:    be constant.\\n2052: \\n2053:    This is subtly different than anti_adjust_stack_and_probe to try and\\n2054:    prevent stack-clash attacks\\n2055: \\n2056:      1. It must assume no knowledge of the probing state, any allocation\\n2057: \\tmust probe.\\n2058: \\n2059: \\tConsider the case of a 1 byte alloca in a loop.  If the sum of the\\n2060: \\tallocations is large, then this could be used to jump the guard if\\n2061: \\tprobes were not emitted.\\n2062: \\n2063:      2. It never skips probes, whereas anti_adjust_stack_and_probe will\\n2064: \\tskip the probe on the first PROBE_INTERVAL on the assumption it\\n2065: \\twas already done in the prologue and in previous allocations.\\n2066: \\n2067:      3. It only allocates and probes SIZE bytes, it does not need to\\n2068: \\tallocate/probe beyond that because this probing style does not\\n2069: \\tguarantee signal handling capability if the guard is hit.  */\\n2070: \\n2071: void\\n2072: anti_adjust_stack_and_probe_stack_clash (rtx size)\\n2073: {\\n2074:   /* First ensure SIZE is Pmode.  */\\n2075:   if (GET_MODE (size) != VOIDmode && GET_MODE (size) != Pmode)\\n2076:     size = convert_to_mode (Pmode, size, 1);\\n2077: \\n2078:   /* We can get here with a constant size on some targets.  */\\n2079:   rtx rounded_size, last_addr, residual;\\n2080:   HOST_WIDE_INT probe_interval, probe_range;\\n2081:   bool target_probe_range_p = false;\\n2082:   compute_stack_clash_protection_loop_data (&rounded_size, &last_addr,\\n2083: \\t\\t\\t\\t\\t    &residual, &probe_interval, size);\\n2084: \\n2085:   /* Get the back-end specific probe ranges.  */\\n2086:   probe_range = targetm.stack_clash_protection_alloca_probe_range ();\\n2087:   target_probe_range_p = probe_range != 0;\\n2088:   gcc_assert (probe_range >= 0);\\n2089: \\n2090:   /* If no back-end specific range defined, default to the top of the newly\\n2091:      allocated range.  */\\n2092:   if (probe_range == 0)\\n209...
28. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/common.opt",
  "startLine": 3050,
  "endLine": 3060
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/common.opt%3FL3050-3060\\n3050: fstack-check\\n3051: Common Alias(fstack-check=, specific, no)\\n3052: Insert stack checking code into the program.  Same as -fstack-check=specific.\\n3053: \\n3054: fstack-clash-protection\\n3055: Common Var(flag_stack_clash_protection) Optimization\\n3056: Insert code to probe each page of stack space as it is allocated to protect\\n3057: from stack-clash style attacks.\\n3058: \\n3059: ; The real option is fno-stack-limit.\\n3060: fstack-limit\\n3061: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/common.opt%3FL3050-3060\n3050: fstack-check\n3051: Common Alias(fstack-check=, specific, no)\n3052: Insert stack checking code into the program.  Same as -fstack-check=specific.\n3053: \n3054: fstack-clash-protection\n3055: Common Var(flag_stack_clash_protection) Optimization\n3056: Insert code to probe each page of stack space as it is allocated to protect\n3057: from stack-clash style attacks.\n3058: \n3059: ; The real option is fno-stack-limit.\n3060: fstack-limit\n3061: '}}
29. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/testsuite/gcc.target/i386/stack-clash-protection.c"
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/testsuite/gcc.target/i386/stack-clash-protection.c\\n1: /* { dg-do compile } */\\n2: /* { dg-options \\"-O2 -fstack-clash-protection\\" } */\\n3: \\n4: int flag;\\n5: void open();\\n6: int getChar();\\n7: typedef enum { QUOTE } CharType;\\n8: typedef enum { UNQ } State;\\n9: CharType getCharType();\\n10: void expand() {\\n11:   open();\\n12:   if (flag)\\n13:     return;\\n14:   int ch = getChar();\\n15:   State nextState = getCharType();\\n16:   if (nextState)\\n17:     while (ch)\\n18:       ;\\n19: }\\n20: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/testsuite/gcc.target/i386/stack-clash-protection.c\n1: /* { dg-do compile } */\n2: /* { dg-options "-O2 -fstack-clash-protection" } */\n3: \n4: int flag;\n5: void open();\n6: int getChar();\n7: typedef enum { QUOTE } CharType;\n8: typedef enum { UNQ } State;\n9: CharType getCharType();\n10: void expand() {\n11:   open();\n12:   if (flag)\n13:     return;\n14:   int ch = getChar();\n15:   State nextState = getCharType();\n16:   if (nextState)\n17:     while (ch)\n18:       ;\n19: }\n20: '}}
30. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/target.def",
  "startLine": 6525,
  "endLine": 6560
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/target.def%3FL6525-6560\\n6525: that shouldn\'t be used.\\\\n\\\\\\n6526: \\\\n\\\\\\n6527: (However, if this class is not included in @code{GENERAL_REGS} and all\\\\n\\\\\\n6528: of the insn patterns whose constraints permit this class are\\\\n\\\\\\n6529: controlled by target switches, then GCC will automatically avoid using\\\\n\\\\\\n6530: these registers when the target switches are opposed to them.)\\",\\n6531:  void, (void),\\n6532:  hook_void_void)\\n6533: \\n6534: DEFHOOK\\n6535: (stack_clash_protection_alloca_probe_range,\\n6536:  \\"Some targets have an ABI defined interval for which no probing needs to be done.\\\\n\\\\\\n6537: When a probe does need to be done this same interval is used as the probe distance\\\\n\\\\\\n6538: up when doing stack clash protection for alloca.\\\\n\\\\\\n6539: On such targets this value can be set to override the default probing up interval.\\\\n\\\\\\n6540: Define this variable to return nonzero if such a probe range is required or zero otherwise.\\\\n\\\\\\n6541: Defining this hook also requires your functions which make use of alloca to have at least 8 byes\\\\n\\\\\\n6542: of outgoing arguments.  If this is not the case the stack will be corrupted.\\\\n\\\\\\n6543: You need not define this macro if it would always have the value zero.\\",\\n6544:  HOST_WIDE_INT, (void),\\n6545:  default_stack_clash_protection_alloca_probe_range)\\n6546: \\n6547: \\n6548: /* Functions specific to the C family of frontends.  */\\n6549: #undef HOOK_PREFIX\\n6550: #define HOOK_PREFIX \\"TARGET_C_\\"\\n6551: HOOK_VECTOR (TARGET_C, c)\\n6552: \\n6553: /* ??? Documenting this hook requires a GFDL license grant.  */\\n6554: DEFHOOK_UNDOC\\n6555: (mode_for_suffix,\\n6556: \\"Return machine mode for non-standard constant literal suffix @var{c},\\\\\\n6557:  or VOIDmode if non-standard suffixes are unsupported.\\",\\n6558:  machine_mode, (char c),\\n6559:  default_mode_for_suffix)\\n6560: \\n6561: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/target.def%3FL6525-6560\n6525: that shouldn\'t be used.\\n\\\n6526: \\n\\\n6527: (However, if this class is not included in @code{GENERAL_REGS} and all\\n\\\n6528: of the insn patterns whose constraints permit this class are\\n\\\n6529: controlled by target switches, then GCC will automatically avoid using\\n\\\n6530: these registers when the target switches are opposed to them.)",\n6531:  void, (void),\n6532:  hook_void_void)\n6533: \n6534: DEFHOOK\n6535: (stack_clash_protection_alloca_probe_range,\n6536:  "Some targets have an ABI defined interval for which no probing needs to be done.\\n\\\n6537: When a probe does need to be done this same interval is used as the probe distance\\n\\\n6538: up when doing stack clash protection for alloca.\\n\\\n6539: On such targets this value can be set to override the default probing up interval.\\n\\\n6540: Define this variable to return nonzero if such a probe range is required or zero otherwise.\\n\\\n6541: Defining this hook also requires your functions which make use of alloca to have at least 8 byes\\n\\\n6542: of outgoing arguments.  If this is not the case the stack will be corrupted.\\n\\\n6543: You need not define this macro if it would always have the value zero.",\n6544:  HOST_WIDE_INT, (void),\n6545:  default_stack_clash_protection_alloca_probe_range)\n6546: \n6547: \n6548: /* Functions specific to the C family of frontends.  */\n6549: #undef HOOK_PREFIX\n6550: #define HOOK_PREFIX "TARGET_C_"\n6551: HOOK_VECTOR (TARGET_C, c)\n6552: \n6553: /* ??? Documenting this hook requires a GFDL license grant.  */\n6554: DEFHOOK_UNDOC\n6555: (mode_for_suffix,\n6556: "Return machine mode for non-standard constant literal suffix @var{c},\\\n6557:  or VOIDmode if non-standard suffixes ar...
31. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"stack_clash\" file:i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
32. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/config/i386/i386.cc",
  "startLine": 1,
  "endLine": 100
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.cc%3FL1-100\\n1: /* Subroutines used for code generation on IA-32.\\n2:    Copyright (C) 1988-2026 Free Software Foundation, Inc.\\n3: \\n4: This file is part of GCC.\\n5: \\n6: GCC is free software; you can redistribute it and/or modify\\n7: it under the terms of the GNU General Public License as published by\\n8: the Free Software Foundation; either version 3, or (at your option)\\n9: any later version.\\n10: \\n11: GCC is distributed in the hope that it will be useful,\\n12: but WITHOUT ANY WARRANTY; without even the implied warranty of\\n13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\n14: GNU General Public License for more details.\\n15: \\n16: You should have received a copy of the GNU General Public License\\n17: along with GCC; see the file COPYING3.  If not see\\n18: <http://www.gnu.org/licenses/>.  */\\n19: \\n20: #define INCLUDE_STRING\\n21: #define IN_TARGET_CODE 1\\n22: \\n23: #include \\"config.h\\"\\n24: #include \\"system.h\\"\\n25: #include \\"coretypes.h\\"\\n26: #include \\"backend.h\\"\\n27: #include \\"rtl.h\\"\\n28: #include \\"tree.h\\"\\n29: #include \\"memmodel.h\\"\\n30: #include \\"gimple.h\\"\\n31: #include \\"cfghooks.h\\"\\n32: #include \\"cfgloop.h\\"\\n33: #include \\"df.h\\"\\n34: #include \\"tm_p.h\\"\\n35: #include \\"stringpool.h\\"\\n36: #include \\"expmed.h\\"\\n37: #include \\"optabs.h\\"\\n38: #include \\"regs.h\\"\\n39: #include \\"emit-rtl.h\\"\\n40: #include \\"recog.h\\"\\n41: #include \\"cgraph.h\\"\\n42: #include \\"diagnostic.h\\"\\n43: #include \\"cfgbuild.h\\"\\n44: #include \\"alias.h\\"\\n45: #include \\"fold-const.h\\"\\n46: #include \\"attribs.h\\"\\n47: #include \\"calls.h\\"\\n48: #include \\"stor-layout.h\\"\\n49: #include \\"varasm.h\\"\\n50: #include \\"output.h\\"\\n51: #include \\"insn-attr.h\\"\\n52: #include \\"flags.h\\"\\n53: #include \\"except.h\\"\\n54: #include \\"explow.h\\"\\n55: #include \\"expr.h\\"\\n56: #include \\"cfgrtl.h\\"\\n57: #include \\"common/common-target.h\\"\\n58: #include \\"langhooks.h\\"\\n59: #include \\"reload.h\\"\\n60: #include \\"gimplify.h\\"\\n61: #include \\"dwarf2.h\\"\\n62: #include \\"tm-constrs.h\\"\\n63: #include \\"cselib.h\\"\\n64: #include \\"sched-int.h\\"\\n65: #include \\"opts.h\\"\\n66: #include \\"tree-pass.h\\"\\n67: #include \\"context.h\\"\\n68: #include \\"pass_manager.h\\"\\n69: #include \\"target-globals.h\\"\\n70: #include \\"gimple-iterator.h\\"\\n71: #include \\"gimple-fold.h\\"\\n72: #include \\"tree-vectorizer.h\\"\\n73: #include \\"shrink-wrap.h\\"\\n74: #include \\"builtins.h\\"\\n75: #include \\"rtl-iter.h\\"\\n76: #include \\"tree-iterator.h\\"\\n77: #include \\"dbgcnt.h\\"\\n78: #include \\"case-cfn-macros.h\\"\\n79: #include \\"dojump.h\\"\\n80: #include \\"fold-const-call.h\\"\\n81: #include \\"tree-vrp.h\\"\\n82: #include \\"tree-ssanames.h\\"\\n83: #include \\"selftest.h\\"\\n84: #include \\"selftest-rtl.h\\"\\n85: #include \\"print-rtl.h\\"\\n86: #include \\"intl.h\\"\\n87: #include \\"ifcvt.h\\"\\n88: #include \\"symbol-summary.h\\"\\n89: #include \\"sreal.h\\"\\n90: #include \\"ipa-cp.h\\"\\n91: #include \\"ipa-prop.h\\"\\n92: #include \\"ipa-fnsummary.h\\"\\n93: #include \\"wide-int-bitmask.h\\"\\n94: #include \\"tree-vector-builder.h\\"\\n95: #include \\"debug.h\\"\\n96: #include \\"dwarf2out.h\\"\\n97: #include \\"i386-options.h\\"\\n98: #include \\"i386-builtins.h\\"\\n99: #include \\"i386-expand.h\\"\\n100: #include \\"i386-features.h\\"\\n101: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.cc%3FL1-100\n1: /* Subroutines used for code generation on IA-32.\n2:    Copyright (C) 1988-2026 Free Software Foundation, Inc.\n3: \n4: This file is part of GCC.\n5: \n6: GCC is free software; you can redi...
33. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"ix86_expand_prologue\" OR \"anti_adjust_stack_and_probe_stack_clash\" file:config/i386"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\\n33: extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);\\n34: extern void ix86_expand_prologue (void);\\n35: extern void ix86_maybe_emit_epilogue_vzeroupper (void);\\n36: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\\n21106:   \\"\\"\\n21107:   \\"ix86_expand_prologue (); DONE;\\")\\n21108: \\n21109: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n33: extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);\n34: extern void ix86_expand_prologue (void);\n35: extern void ix86_maybe_emit_epilogue_vzeroupper (void);\n36: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n21106:   ""\n21107:   "ix86_expand_prologue (); DONE;")\n21108: \n21109: \n'}}
34. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"void ix86_expand_prologue\""
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\\n33: extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);\\n34: extern void ix86_expand_prologue (void);\\n35: extern void ix86_maybe_emit_epilogue_vzeroupper (void);\\n36: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n33: extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);\n34: extern void ix86_expand_prologue (void);\n35: extern void ix86_maybe_emit_epilogue_vzeroupper (void);\n36: \n'}}
35. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ ix86_expand_prologue file:i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
36. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ stack_clash file:gcc/config"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/rs6000/rs6000-logue.cc\\n1553: static rtx_insn *\\n1554: rs6000_emit_probe_stack_range_stack_clash (HOST_WIDE_INT orig_size,\\n1555: \\t\\t\\t\\t\\t   rtx copy_reg)\\n1556: \\n1950: static const char *\\n1951: output_probe_stack_range_stack_clash (rtx reg1, rtx reg2, rtx reg3)\\n1952: {\\n1953: \\n1529: static HOST_WIDE_INT\\n1530: get_stack_clash_protection_probe_interval (void)\\n1531: {\\n1532: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/aarch64/aarch64.h\\n102:    before probing has to be done for stack clash protection.  */\\n103: #define STACK_CLASH_CALLER_GUARD 1024\\n104: \\n105: \\n106:    outgoing arguments to be when stack-clash is enabled.  */\\n107: #define STACK_CLASH_MIN_BYTES_OUTGOING_ARGS 8\\n108: \\n109: \\n110:    generating stack clash probes.  */\\n111: #define STACK_CLASH_MAX_UNROLL_PAGES 4\\n112: \\n113: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.h\\n1305:    before probing has to be done for stack clash protection.  */\\n1306: #define STACK_CLASH_CALLER_GUARD 1024\\n1307: \\n1308: \\n1309:    generating stack clash probes.  */\\n1310: #define STACK_CLASH_MAX_UNROLL_PAGES 4\\n1311: \\n1312: \\n1313:    outgoing arguments to be when stack-clash is enabled.  */\\n1314: #define STACK_CLASH_MIN_BYTES_OUTGOING_ARGS 8\\n1315: \\n1316: /* Allocate a minimum of STACK_CLASH_MIN_BYTES_OUTGOING_ARGS bytes for the\\n1317:    outgoing arguments if stack clash protection is enabled.  This is essential\\n1318: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/loongarch/loongarch.h\\n672:    generating stack clash probes.  */\\n673: #define STACK_CLASH_MAX_UNROLL_PAGES 4\\n674: \\n675: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/loongarch/loongarch.cc\\n265: /* Size of guard page.  */\\n266: #define STACK_CLASH_PROTECTION_GUARD_SIZE \\\\\\n267:   (1 << param_stack_clash_protection_guard_size)\\n268: \\n269: \\n1108:   if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK\\n1109:       || (flag_stack_clash_protection\\n1110: \\t  && frame->total_size > STACK_CLASH_PROTECTION_GUARD_SIZE))\\n1111:     return min_first_step;\\n1112: \\n1152: \\n1153:   if (flag_stack_clash_protection)\\n1154:     interval = STACK_CLASH_PROTECTION_GUARD_SIZE;\\n1155:   else\\n1156: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\\n15598: static HOST_WIDE_INT\\n15599: riscv_stack_clash_protection_alloca_probe_range (void)\\n15600: {\\n15601:   return STACK_CLASH_CALLER_GUARD;\\n15602: }\\n15603: \\n16846: \\n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\\\\n16849:   riscv_stack_clash_protection_alloca_probe_range\\n16850: \\n16851: \\n9521:   emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx,\\n9522: \\t\\t    STACK_CLASH_CALLER_GUARD));\\n9523:   emit_insn (gen_blockage ());\\n9524: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/configure.ac\\n891: [Set the default stack clash protection guard size for specific targets as a power of two in bytes.])],\\n892: [DEFAULT_STK_CLASH_GUARD_SIZE=\\"$with_stack_clash_protection_guard_size\\"], [DEFAULT_STK_CLASH_GUARD_SIZE=0])\\n893: if test $DEFAULT_STK_CLASH_GUARD_SIZE -ne 0 \\\\\\n894: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/alpha/alpha.cc\\n8478:   probed_size = frame_size;\\n8479:   if (flag_stack_check || flag_stack_clash_protection)\\n8480:     probed_size += get_stack_check_protect ();\\n8481: \\n8493: \\t  if ((sa_size == 0 && probed_size > probed - 4096)\\n8494: \\t      || flag_stack_check || flag_stack_clash_protection)\\n8495: \\t    emit_insn (gen_stack_probe_internal (GEN_INT (-probed_size)));\\n8496: \\n8524:       if ((leftover > 4096 && sa_size == 0)\\n8525: \\t  || flag_stack_check || flag_stack_clash_protection)\\n8526: \\t{\\n8527: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/mips/mips.cc\\n12625:   if (flag_stack_check == S...
37. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"flag_stack_clash_protection\" file:i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
38. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"flag_stack_clash_protection\" file:i386-expand.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
39. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"probe_stack_range\" file:config/i386"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\\n102: extern const char *output_adjust_stack_and_probe (rtx);\\n103: extern const char *output_probe_stack_range (rtx, rtx);\\n104: \\n105: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\\n233:   UNSPECV_STACK_PROBE\\n234:   UNSPECV_PROBE_STACK_RANGE\\n235:   UNSPECV_ALIGN\\n236: \\n27820: \\t(unspec_volatile:P [(match_operand:P 1 \\"register_operand\\" \\"0\\")]\\n27821: \\t\\t\\t    UNSPECV_PROBE_STACK_RANGE))\\n27822:    (set (reg:P SP_REG)\\n27823: \\n27833: \\t\\t\\t    (match_operand:P 2 \\"const_int_operand\\")]\\n27834: \\t\\t\\t    UNSPECV_PROBE_STACK_RANGE))\\n27835:    (clobber (reg:CC FLAGS_REG))]\\n27836: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n102: extern const char *output_adjust_stack_and_probe (rtx);\n103: extern const char *output_probe_stack_range (rtx, rtx);\n104: \n105: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n233:   UNSPECV_STACK_PROBE\n234:   UNSPECV_PROBE_STACK_RANGE\n235:   UNSPECV_ALIGN\n236: \n27820: \t(unspec_volatile:P [(match_operand:P 1 "register_operand" "0")]\n27821: \t\t\t    UNSPECV_PROBE_STACK_RANGE))\n27822:    (set (reg:P SP_REG)\n27823: \n27833: \t\t\t    (match_operand:P 2 "const_int_operand")]\n27834: \t\t\t    UNSPECV_PROBE_STACK_RANGE))\n27835:    (clobber (reg:CC FLAGS_REG))]\n27836: \n'}}
40. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"ix86_adjust_stack_and_probe\" OR \"probe_stack\" file:i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
41. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"output_adjust_stack_and_probe\" OR \"output_probe_stack_range\" file:i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
42. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"output_adjust_stack_and_probe\" OR \"output_probe_stack_range\""
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\\n102: extern const char *output_adjust_stack_and_probe (rtx);\\n103: extern const char *output_probe_stack_range (rtx, rtx);\\n104: \\n105: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/rs6000/rs6000-logue.cc\\n1872: static const char *\\n1873: output_probe_stack_range_1 (rtx reg1, rtx reg2)\\n1874: {\\n1875: \\n1986: \\n1987: /* Wrapper around the output_probe_stack_range routines.  */\\n1988: const char *\\n1989: output_probe_stack_range (rtx reg1, rtx reg2, rtx reg3)\\n1990: {\\n1991: \\n1950: static const char *\\n1951: output_probe_stack_range_stack_clash (rtx reg1, rtx reg2, rtx reg3)\\n1952: {\\n1953: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/ia64/ia64-protos.h\\n61: extern const char *get_bundle_name (int);\\n62: extern const char *output_probe_stack_range (rtx, rtx);\\n63: \\n64: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/sparc/sparc-protos.h\\n80: extern const char *output_v9branch (rtx, rtx, int, int, int, int, rtx_insn *);\\n81: extern const char *output_probe_stack_range (rtx, rtx);\\n82: extern const char *output_cbcond (rtx, rtx, rtx_insn *);\\n83: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/loongarch/loongarch-protos.h\\n148: extern const char *loongarch_lsx_output_division (const char *, rtx *);\\n149: extern const char *loongarch_output_probe_stack_range (rtx, rtx, rtx);\\n150: extern bool loongarch_hard_regno_rename_ok (unsigned int, unsigned int);\\n151: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/mips/mips-protos.h\\n320: extern const char *mips_msa_output_shift_immediate (const char *, rtx *);\\n321: extern const char *mips_output_probe_stack_range (rtx, rtx);\\n322: extern bool mips_hard_regno_rename_ok (unsigned int, unsigned int);\\n323: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/rs6000/rs6000-protos.h\\n123: extern char * output_cbranch (rtx, const char *, int, rtx_insn *);\\n124: extern const char * output_probe_stack_range (rtx, rtx, rtx);\\n125: extern void rs6000_emit_dot_insn (rtx dst, rtx src, int dot, rtx ccreg);\\n126: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/arm/arm-protos.h\\n178: extern const char *output_return_instruction (rtx, bool, bool, bool);\\n179: extern const char *output_probe_stack_range (rtx, rtx);\\n180: extern void arm_poke_function_name (FILE *, const char *);\\n181: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/aarch64/aarch64-protos.h\\n1028: const char * aarch64_gen_far_branch (rtx *, int, const char *, const char *);\\n1029: const char * aarch64_output_probe_stack_range (rtx, rtx);\\n1030: const char * aarch64_output_probe_sve_stack_clash (rtx, rtx, rtx, rtx);\\n1031: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/ia64/ia64.cc\\n3443: const char *\\n3444: output_probe_stack_range (rtx reg1, rtx reg2)\\n3445: {\\n3446: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/loongarch/loongarch.cc\\n1259: const char *\\n1260: loongarch_output_probe_stack_range (rtx reg1, rtx reg2, rtx reg3)\\n1261: {\\n1262: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/sparc/sparc.cc\\n5728: const char *\\n5729: output_probe_stack_range (rtx reg1, rtx reg2)\\n5730: {\\n5731: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/mips/mips.cc\\n12551: const char *\\n12552: mips_output_probe_stack_range (rtx reg1, rtx reg2)\\n12553: {\\n12554: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/loongarch/loongarch.md\\n3931: {\\n3932:   return loongarch_output_probe_stack_range (operands[0],\\n3933: \\t\\t\\t\\t\\t     operands[2],\\n3934: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/ia64/ia64.md\\n5236:   \\"\\"\\n5237:   \\"* return output_probe_stack_range (operands[0], operands[2]);\\"\\n5238:   [(set_attr \\"itanium_class\\" \\"unknown\\")\\n5239: \\n"}', 'structuredContent': {'text': '# github.com/sg-eva...
43. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"output_adjust_stack_and_probe\" file:i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
44. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"output_adjust_stack_and_probe\" OR \"ix86_expand_prologue\" file:i386-expand.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
45. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"output_adjust_stack_and_probe\""
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\\n102: extern const char *output_adjust_stack_and_probe (rtx);\\n103: extern const char *output_probe_stack_range (rtx, rtx);\\n104: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\\n27826:   \\"\\"\\n27827:   \\"* return output_adjust_stack_and_probe (operands[0]);\\"\\n27828:   [(set_attr \\"type\\" \\"multi\\")])\\n27829: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\n102: extern const char *output_adjust_stack_and_probe (rtx);\n103: extern const char *output_probe_stack_range (rtx, rtx);\n104: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n27826:   ""\n27827:   "* return output_adjust_stack_and_probe (operands[0]);"\n27828:   [(set_attr "type" "multi")])\n27829: \n'}}
46. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/config/i386/i386.md",
  "startLine": 27800,
  "endLine": 27850
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.md%3FL27800-27850\\n27800: {\\n27801:   emit_insn (gen_probe_stack_1\\n27802: \\t     (word_mode, operands[0], const0_rtx));\\n27803:   DONE;\\n27804: })\\n27805: \\n27806: ;; Use OR for stack probes, this is shorter.\\n27807: (define_insn \\"@probe_stack_1_<mode>\\"\\n27808:   [(set (match_operand:W 0 \\"memory_operand\\" \\"=m\\")\\n27809: \\t(unspec:W [(match_operand:W 1 \\"const0_operand\\")]\\n27810: \\t\\t  UNSPEC_PROBE_STACK))\\n27811:    (clobber (reg:CC FLAGS_REG))]\\n27812:   \\"\\"\\n27813:   \\"or{<imodesuffix>}\\\\t{%1, %0|%0, %1}\\"\\n27814:   [(set_attr \\"type\\" \\"alu1\\")\\n27815:    (set_attr \\"mode\\" \\"<MODE>\\")\\n27816:    (set_attr \\"length_immediate\\" \\"1\\")])\\n27817:   \\n27818: (define_insn \\"@adjust_stack_and_probe_<mode>\\"\\n27819:   [(set (match_operand:P 0 \\"register_operand\\" \\"=r\\")\\n27820: \\t(unspec_volatile:P [(match_operand:P 1 \\"register_operand\\" \\"0\\")]\\n27821: \\t\\t\\t    UNSPECV_PROBE_STACK_RANGE))\\n27822:    (set (reg:P SP_REG)\\n27823:         (minus:P (reg:P SP_REG) (match_operand:P 2 \\"const_int_operand\\")))\\n27824:    (clobber (reg:CC FLAGS_REG))\\n27825:    (clobber (mem:BLK (scratch)))]\\n27826:   \\"\\"\\n27827:   \\"* return output_adjust_stack_and_probe (operands[0]);\\"\\n27828:   [(set_attr \\"type\\" \\"multi\\")])\\n27829: \\n27830: (define_insn \\"@probe_stack_range_<mode>\\"\\n27831:   [(set (match_operand:P 0 \\"register_operand\\" \\"=r\\")\\n27832: \\t(unspec_volatile:P [(match_operand:P 1 \\"register_operand\\" \\"0\\")\\n27833: \\t\\t\\t    (match_operand:P 2 \\"const_int_operand\\")]\\n27834: \\t\\t\\t    UNSPECV_PROBE_STACK_RANGE))\\n27835:    (clobber (reg:CC FLAGS_REG))]\\n27836:   \\"\\"\\n27837:   \\"* return output_probe_stack_range (operands[0], operands[2]);\\"\\n27838:   [(set_attr \\"type\\" \\"multi\\")])\\n27839: \\n27840: (define_expand \\"builtin_setjmp_receiver\\"\\n27841:   [(label_ref (match_operand 0))]\\n27842:   \\"!TARGET_64BIT && flag_pic\\"\\n27843: {\\n27844: #if TARGET_MACHO\\n27845:   if (TARGET_MACHO)\\n27846:     {\\n27847:       rtx xops[3];\\n27848:       rtx_code_label *label_rtx = gen_label_rtx ();\\n27849:       emit_insn (gen_set_got_labelled (pic_offset_table_rtx, label_rtx));\\n27850:       xops[0] = xops[1] = pic_offset_table_rtx;\\n27851: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.md%3FL27800-27850\n27800: {\n27801:   emit_insn (gen_probe_stack_1\n27802: \t     (word_mode, operands[0], const0_rtx));\n27803:   DONE;\n27804: })\n27805: \n27806: ;; Use OR for stack probes, this is shorter.\n27807: (define_insn "@probe_stack_1_<mode>"\n27808:   [(set (match_operand:W 0 "memory_operand" "=m")\n27809: \t(unspec:W [(match_operand:W 1 "const0_operand")]\n27810: \t\t  UNSPEC_PROBE_STACK))\n27811:    (clobber (reg:CC FLAGS_REG))]\n27812:   ""\n27813:   "or{<imodesuffix>}\\t{%1, %0|%0, %1}"\n27814:   [(set_attr "type" "alu1")\n27815:    (set_attr "mode" "<MODE>")\n27816:    (set_attr "length_immediate" "1")])\n27817:   \n27818: (define_insn "@adjust_stack_and_probe_<mode>"\n27819:   [(set (match_operand:P 0 "register_operand" "=r")\n27820: \t(unspec_volatile:P [(match_operand:P 1 "register_operand" "0")]\n27821: \t\t\t    UNSPECV_PROBE_STACK_RANGE))\n27822:    (set (reg:P SP_REG)\n27823:         (minus:P (reg:P SP_REG) (match_operand:P 2 "const_int_operand")))\n27824:    (clobber (reg:CC FLAGS_REG))\n27825:    (clobber (mem:BLK (scratch)))]\n27826:   ""\n27827:   "* return output_adjust_stack_and_probe (operands[0]);"\n27828:   [(set_attr "type" "multi")])\n27829: \n27830: (define_insn "@probe_stack_range_<mode>"\n27831:   [(set (match_operand:P 0 "register_operand" "=r")\n27832: \t(unspec_volatile:P [(match_operand:P 1 "register...
47. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"output_adjust_stack_and_probe\" file:config/i386/i386.cc"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
48. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"const char\" \"output_adjust_stack_and_probe\""
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\\n96: \\n97: extern const char *output_set_got (rtx, rtx);\\n98: extern const char *output_387_binary_op (rtx_insn *, rtx*);\\n99: extern const char *output_387_reg_move (rtx_insn *, rtx*);\\n100: extern const char *output_fix_trunc (rtx_insn *, rtx*, bool);\\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\\n102: extern const char *output_adjust_stack_and_probe (rtx);\\n103: extern const char *output_probe_stack_range (rtx, rtx);\\n104: \\n105: \\n320: /* In winnt.cc  */\\n321: extern void i386_pe_record_external_function (tree, const char *);\\n322: extern bool i386_pe_binds_local_p (const_tree);\\n323: extern const char *i386_pe_strip_name_encoding_full (const char *);\\n324: extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree,\\n325: \\t\\t\\t\\t\\t\\t    const char *,\\n326: \\t\\t\\t\\t\\t\\t    HOST_WIDE_INT,\\n327: \\n201: extern bool ix86_function_arg_regno_p (int);\\n202: extern void ix86_asm_output_function_label (FILE *, const char *, tree);\\n203: extern void ix86_asm_output_labelref (FILE *, const char *, const char *);\\n204: extern void ix86_call_abi_override (const_tree);\\n205: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\\n3165:   char buf[128];\\n3166:   const char *ops;\\n3167:   const char *suffix;\\n3168: \\n3169: \\n29664: {\\n29665:   static const char * const patterns[4] = {\\n29666:    \\"prefetchnta\\\\t%a0\\", \\"prefetcht2\\\\t%a0\\", \\"prefetcht1\\\\t%a0\\", \\"prefetcht0\\\\t%a0\\"\\n29667: \\n29701: {\\n29702:   static const char * const patterns[2] = {\\n29703:     \\"prefetchit1\\\\t%a0\\", \\"prefetchit0\\\\t%a0\\"\\n29704: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n96: \n97: extern const char *output_set_got (rtx, rtx);\n98: extern const char *output_387_binary_op (rtx_insn *, rtx*);\n99: extern const char *output_387_reg_move (rtx_insn *, rtx*);\n100: extern const char *output_fix_trunc (rtx_insn *, rtx*, bool);\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\n102: extern const char *output_adjust_stack_and_probe (rtx);\n103: extern const char *output_probe_stack_range (rtx, rtx);\n104: \n105: \n320: /* In winnt.cc  */\n321: extern void i386_pe_record_external_function (tree, const char *);\n322: extern bool i386_pe_binds_local_p (const_tree);\n323: extern const char *i386_pe_strip_name_encoding_full (const char *);\n324: extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree,\n325: \t\t\t\t\t\t    const char *,\n326: \t\t\t\t\t\t    HOST_WIDE_INT,\n327: \n201: extern bool ix86_function_arg_regno_p (int);\n202: extern void ix86_asm_output_function_label (FILE *, const char *, tree);\n203: extern void ix86_asm_output_labelref (FILE *, const char *, const char *);\n204: extern void ix86_call_abi_override (const_tree);\n205: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n3165:   char buf[128];\n3166:   const char *ops;\n3167:   const char *suffix;\n3168: \n3169: \n29664: {\n29665:   static const char * const patterns[4] = {\n29666:    "prefetchnta\\t%a0", "prefetcht2\\t%a0", "prefetcht1\\t%a0", "prefetcht0\\t%a0"\n29667: \n29701: {\n29702:   static const char * const patterns[2] = {\n29703:     "prefetchit1\\t%a0", "prefetchit0\\t%a0"\n29704: \n'}}
49. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ output_adjust_stack_and_probe"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\\n27826:   \\"\\"\\n27827:   \\"* return output_adjust_stack_and_probe (operands[0]);\\"\\n27828:   [(set_attr \\"type\\" \\"multi\\")])\\n27829: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\\n102: extern const char *output_adjust_stack_and_probe (rtx);\\n103: extern const char *output_probe_stack_range (rtx, rtx);\\n104: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386.md\n27826:   ""\n27827:   "* return output_adjust_stack_and_probe (operands[0]);"\n27828:   [(set_attr "type" "multi")])\n27829: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/i386/i386-protos.h\n101: extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);\n102: extern const char *output_adjust_stack_and_probe (rtx);\n103: extern const char *output_probe_stack_range (rtx, rtx);\n104: \n'}}
50. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/config/i386/i386.cc",
  "startLine": 1,
  "endLine": 50
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.cc%3FL1-50\\n1: /* Subroutines used for code generation on IA-32.\\n2:    Copyright (C) 1988-2026 Free Software Foundation, Inc.\\n3: \\n4: This file is part of GCC.\\n5: \\n6: GCC is free software; you can redistribute it and/or modify\\n7: it under the terms of the GNU General Public License as published by\\n8: the Free Software Foundation; either version 3, or (at your option)\\n9: any later version.\\n10: \\n11: GCC is distributed in the hope that it will be useful,\\n12: but WITHOUT ANY WARRANTY; without even the implied warranty of\\n13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\n14: GNU General Public License for more details.\\n15: \\n16: You should have received a copy of the GNU General Public License\\n17: along with GCC; see the file COPYING3.  If not see\\n18: <http://www.gnu.org/licenses/>.  */\\n19: \\n20: #define INCLUDE_STRING\\n21: #define IN_TARGET_CODE 1\\n22: \\n23: #include \\"config.h\\"\\n24: #include \\"system.h\\"\\n25: #include \\"coretypes.h\\"\\n26: #include \\"backend.h\\"\\n27: #include \\"rtl.h\\"\\n28: #include \\"tree.h\\"\\n29: #include \\"memmodel.h\\"\\n30: #include \\"gimple.h\\"\\n31: #include \\"cfghooks.h\\"\\n32: #include \\"cfgloop.h\\"\\n33: #include \\"df.h\\"\\n34: #include \\"tm_p.h\\"\\n35: #include \\"stringpool.h\\"\\n36: #include \\"expmed.h\\"\\n37: #include \\"optabs.h\\"\\n38: #include \\"regs.h\\"\\n39: #include \\"emit-rtl.h\\"\\n40: #include \\"recog.h\\"\\n41: #include \\"cgraph.h\\"\\n42: #include \\"diagnostic.h\\"\\n43: #include \\"cfgbuild.h\\"\\n44: #include \\"alias.h\\"\\n45: #include \\"fold-const.h\\"\\n46: #include \\"attribs.h\\"\\n47: #include \\"calls.h\\"\\n48: #include \\"stor-layout.h\\"\\n49: #include \\"varasm.h\\"\\n50: #include \\"output.h\\"\\n51: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.cc%3FL1-50\n1: /* Subroutines used for code generation on IA-32.\n2:    Copyright (C) 1988-2026 Free Software Foundation, Inc.\n3: \n4: This file is part of GCC.\n5: \n6: GCC is free software; you can redistribute it and/or modify\n7: it under the terms of the GNU General Public License as published by\n8: the Free Software Foundation; either version 3, or (at your option)\n9: any later version.\n10: \n11: GCC is distributed in the hope that it will be useful,\n12: but WITHOUT ANY WARRANTY; without even the implied warranty of\n13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n14: GNU General Public License for more details.\n15: \n16: You should have received a copy of the GNU General Public License\n17: along with GCC; see the file COPYING3.  If not see\n18: <http://www.gnu.org/licenses/>.  */\n19: \n20: #define INCLUDE_STRING\n21: #define IN_TARGET_CODE 1\n22: \n23: #include "config.h"\n24: #include "system.h"\n25: #include "coretypes.h"\n26: #include "backend.h"\n27: #include "rtl.h"\n28: #include "tree.h"\n29: #include "memmodel.h"\n30: #include "gimple.h"\n31: #include "cfghooks.h"\n32: #include "cfgloop.h"\n33: #include "df.h"\n34: #include "tm_p.h"\n35: #include "stringpool.h"\n36: #include "expmed.h"\n37: #include "optabs.h"\n38: #include "regs.h"\n39: #include "emit-rtl.h"\n40: #include "recog.h"\n41: #include "cgraph.h"\n42: #include "diagnostic.h"\n43: #include "cfgbuild.h"\n44: #include "alias.h"\n45: #include "fold-const.h"\n46: #include "attribs.h"\n47: #include "calls.h"\n48: #include "stor-layout.h"\n49: #include "varasm.h"\n50: #include "output.h"\n51: '}}
51. ToolSearch

Input

{
  "query": "select:mcp__sourcegraph__sg_go_to_definition",
  "max_results": 1
}

Output

{'matches': ['mcp__sourcegraph__sg_go_to_definition'], 'query': 'select:mcp__sourcegraph__sg_go_to_definition', 'total_deferred_tools': 33}
52. mcp__sourcegraph__sg_go_to_definition

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/config/i386/i386.md",
  "symbol": "output_adjust_stack_and_probe"
}

Output

{'content': '{"text":"No results.\\n\\nno definition found for symbol \'output_adjust_stack_and_probe\'."}', 'structuredContent': {'text': "No results.\n\nno definition found for symbol 'output_adjust_stack_and_probe'."}}
53. mcp__sourcegraph__sg_go_to_definition

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/config/i386/i386.md",
  "symbol": "output_probe_stack_range"
}

Output

{'content': '{"text":"No results.\\n\\nno definition found for symbol \'output_probe_stack_range\'."}', 'structuredContent': {'text': "No results.\n\nno definition found for symbol 'output_probe_stack_range'."}}
54. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/explow.h"
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/explow.h\\n1: /* Export function prototypes from explow.cc.\\n2:    Copyright (C) 2015-2026 Free Software Foundation, Inc.\\n3: \\n4: This file is part of GCC.\\n5: \\n6: GCC is free software; you can redistribute it and/or modify it under\\n7: the terms of the GNU General Public License as published by the Free\\n8: Software Foundation; either version 3, or (at your option) any later\\n9: version.\\n10: \\n11: GCC is distributed in the hope that it will be useful, but WITHOUT ANY\\n12: WARRANTY; without even the implied warranty of MERCHANTABILITY or\\n13: FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\\n14: for more details.\\n15: \\n16: You should have received a copy of the GNU General Public License\\n17: along with GCC; see the file COPYING3.  If not see\\n18: <http://www.gnu.org/licenses/>.  */\\n19: \\n20: #ifndef GCC_EXPLOW_H\\n21: #define GCC_EXPLOW_H\\n22: \\n23: /* Return a memory reference like MEMREF, but which is known to have a\\n24:    valid address.  */\\n25: extern rtx validize_mem (rtx);\\n26: \\n27: extern rtx use_anchored_address (rtx);\\n28: \\n29: /* Copy given rtx to a new temp reg and return that.  */\\n30: extern rtx copy_to_reg (rtx);\\n31: \\n32: /* Like copy_to_reg but always make the reg Pmode.  */\\n33: extern rtx copy_addr_to_reg (rtx);\\n34: \\n35: /* Like copy_to_reg but always make the reg the specified mode MODE.  */\\n36: extern rtx copy_to_mode_reg (machine_mode, rtx);\\n37: \\n38: /* Copy given rtx to given temp reg and return that.  */\\n39: extern rtx copy_to_suggested_reg (rtx, rtx, machine_mode);\\n40: \\n41: /* Copy a value to a register if it isn\'t already a register.\\n42:    Args are mode (in case value is a constant) and the value.  */\\n43: extern rtx force_reg (machine_mode, rtx);\\n44: \\n45: extern rtx force_subreg (machine_mode, rtx, machine_mode, poly_uint64);\\n46: extern rtx force_lowpart_subreg (machine_mode, rtx, machine_mode);\\n47: extern rtx force_highpart_subreg (machine_mode, rtx, machine_mode);\\n48: \\n49: /* Return given rtx, copied into a new temp reg if it was in memory.  */\\n50: extern rtx force_not_mem (rtx);\\n51: \\n52: /* Return mode and signedness to use when an argument or result in the\\n53:    given mode is promoted.  */\\n54: extern machine_mode promote_function_mode (const_tree, machine_mode, int *,\\n55: \\t\\t\\t\\t\\t        const_tree, int);\\n56: \\n57: /* Return mode and signedness to use when an object in the given mode\\n58:    is promoted.  */\\n59: extern machine_mode promote_mode (const_tree, machine_mode, int *);\\n60: \\n61: /* Return mode and signedness to use when object is promoted.  */\\n62: machine_mode promote_decl_mode (const_tree, int *);\\n63: \\n64: /* Return mode and signedness to use when object is promoted.  */\\n65: machine_mode promote_ssa_mode (const_tree, int *);\\n66: \\n67: /* Remove some bytes from the stack.  An rtx says how many.  */\\n68: extern void adjust_stack (rtx);\\n69: \\n70: /* Add some bytes to the stack.  An rtx says how many.  */\\n71: extern void anti_adjust_stack (rtx);\\n72: \\n73: /* Add some bytes to the stack while probing it.  An rtx says how many. */\\n74: extern void anti_adjust_stack_and_probe (rtx, bool);\\n75: \\n76: /* Add some bytes to the stack while probing it.  An rtx says how\\n77:    many.  Add additional probes to prevent stack clashing attacks.  */\\n78: extern void anti_adjust_stack_and_probe_stack_clash (rtx);\\n79: \\n80: /* Support for building allocation/probing loops for stack-clash\\n81:    protection of dyamically allocated stack space.  */\\n82: extern void compute_stack_clash_protection_loop_data (rtx *, rtx *, rtx *,\\n83: \\t\\t\\t\\t\\t\\t      HOST_WIDE_INT *, rtx);\\n84: extern void emit_stack_clash_protection_probe_loop_start (rtx *, rtx *,\\n85: \\t\\t\\t\\t\\t\\t\\t  rtx, bool);\\n86: extern void emi...
55. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"STACK_CLASH\" file:.h"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/explow.h\\n77:    many.  Add additional probes to prevent stack clashing attacks.  */\\n78: extern void anti_adjust_stack_and_probe_stack_clash (rtx);\\n79: \\n80: \\n81:    protection of dyamically allocated stack space.  */\\n82: extern void compute_stack_clash_protection_loop_data (rtx *, rtx *, rtx *,\\n83: \\t\\t\\t\\t\\t\\t      HOST_WIDE_INT *, rtx);\\n84: extern void emit_stack_clash_protection_probe_loop_start (rtx *, rtx *,\\n85: \\t\\t\\t\\t\\t\\t\\t  rtx, bool);\\n86: extern void emit_stack_clash_protection_probe_loop_end (rtx, rtx,\\n87: \\t\\t\\t\\t\\t\\t\\trtx, bool);\\n88: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/aarch64/aarch64.h\\n102:    before probing has to be done for stack clash protection.  */\\n103: #define STACK_CLASH_CALLER_GUARD 1024\\n104: \\n105: \\n110:    generating stack clash probes.  */\\n111: #define STACK_CLASH_MAX_UNROLL_PAGES 4\\n112: \\n113: \\n106:    outgoing arguments to be when stack-clash is enabled.  */\\n107: #define STACK_CLASH_MIN_BYTES_OUTGOING_ARGS 8\\n108: \\n109: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/sve/pcs/stack_clash_3.c\\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/function.h\\n639: \\n640: enum stack_clash_probes {\\n641:   NO_PROBE_NO_FRAME,\\n642: \\n646: \\n647: extern void dump_stack_clash_frame_info (enum stack_clash_probes, bool);\\n648: \\f\\n649: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.h\\n1305:    before probing has to be done for stack clash protection.  */\\n1306: #define STACK_CLASH_CALLER_GUARD 1024\\n1307: \\n1308: \\n1309:    generating stack clash probes.  */\\n1310: #define STACK_CLASH_MAX_UNROLL_PAGES 4\\n1311: \\n1312: \\n1313:    outgoing arguments to be when stack-clash is enabled.  */\\n1314: #define STACK_CLASH_MIN_BYTES_OUTGOING_ARGS 8\\n1315: \\n1316: /* Allocate a minimum of STACK_CLASH_MIN_BYTES_OUTGOING_ARGS bytes for the\\n1317:    outgoing arguments if stack clash protection is enabled.  This is essential\\n1318: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/config/loongarch/loongarch.h\\n672:    generating stack clash probes.  */\\n673: #define STACK_CLASH_MAX_UNROLL_PAGES 4\\n674: \\n675: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/g++.target/aarch64/sve/pr119610-sve.C\\n2: // { dg-additional-options \\"-fstack-protector-strong\\" { target fstack_protector } }\\n3: // { dg-additional-options \\"-fstack-clash-protection\\" { target supports_stack_clash_protection } }\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/stack-check-prologue-1.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/stack-check-prologue-3.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/stack-check-prologue-2.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -fno-stack-protector\\" } */\\n3: /* { dg-require-effective...
56. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"define TARGET_STACK_CLASH_PROTECTION\""
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\\n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\\\\n16849:   riscv_stack_clash_protection_alloca_probe_range\\n16850: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\n16849:   riscv_stack_clash_protection_alloca_probe_range\n16850: \n'}}
57. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"TARGET_STACK_CLASH_PROTECTION\" file:defaults.h"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
58. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"TARGET_STACK_CLASH_PROTECTION\" -\"ALLOCA\""
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
59. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ TARGET_STACK_CLASH_PROTECTION file:targhooks.h"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
60. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ TARGET_STACK_CLASH_PROTECTION file:tm_p.h"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
61. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/targhooks.h",
  "startLine": 295,
  "endLine": 310
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/targhooks.h%3FL295-310\\n295: \\t\\t\\t\\t       optimization_type);\\n296: extern unsigned int default_max_noce_ifcvt_seq_cost (edge);\\n297: extern bool default_noce_conversion_profitable_p (rtx_insn *,\\n298: \\t\\t\\t\\t\\t\\t  struct noce_if_info *);\\n299: extern unsigned int default_min_arithmetic_precision (void);\\n300: \\n301: extern enum flt_eval_method\\n302: default_excess_precision (enum excess_precision_type ATTRIBUTE_UNUSED);\\n303: extern bool default_bitint_type_info (int, struct bitint_info *);\\n304: extern machine_mode default_mode_for_floating_type (enum tree_index);\\n305: extern HOST_WIDE_INT default_stack_clash_protection_alloca_probe_range (void);\\n306: extern void default_select_early_remat_modes (sbitmap);\\n307: extern tree default_preferred_else_value (unsigned, tree, unsigned, tree *);\\n308: extern bool default_instruction_selection (function *, gimple_stmt_iterator *);\\n309: extern bool default_have_speculation_safe_value (bool);\\n310: extern bool speculation_safe_value_not_needed (bool);\\n311: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/targhooks.h%3FL295-310\n295: \t\t\t\t       optimization_type);\n296: extern unsigned int default_max_noce_ifcvt_seq_cost (edge);\n297: extern bool default_noce_conversion_profitable_p (rtx_insn *,\n298: \t\t\t\t\t\t  struct noce_if_info *);\n299: extern unsigned int default_min_arithmetic_precision (void);\n300: \n301: extern enum flt_eval_method\n302: default_excess_precision (enum excess_precision_type ATTRIBUTE_UNUSED);\n303: extern bool default_bitint_type_info (int, struct bitint_info *);\n304: extern machine_mode default_mode_for_floating_type (enum tree_index);\n305: extern HOST_WIDE_INT default_stack_clash_protection_alloca_probe_range (void);\n306: extern void default_select_early_remat_modes (sbitmap);\n307: extern tree default_preferred_else_value (unsigned, tree, unsigned, tree *);\n308: extern bool default_instruction_selection (function *, gimple_stmt_iterator *);\n309: extern bool default_have_speculation_safe_value (bool);\n310: extern bool speculation_safe_value_not_needed (bool);\n311: '}}
62. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/targhooks.cc",
  "startLine": 2740,
  "endLine": 2760
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/targhooks.cc%3FL2740-2760\\n2740: {\\n2741:   return false;\\n2742: }\\n2743: \\n2744: /* Default implementation for\\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\\n2746: HOST_WIDE_INT\\n2747: default_stack_clash_protection_alloca_probe_range (void)\\n2748: {\\n2749:   return 0;\\n2750: }\\n2751: \\n2752: /* The default implementation of TARGET_EARLY_REMAT_MODES.  */\\n2753: \\n2754: void\\n2755: default_select_early_remat_modes (sbitmap)\\n2756: {\\n2757: }\\n2758: \\n2759: /* The default implementation of TARGET_PREFERRED_ELSE_VALUE.  */\\n2760: \\n2761: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/targhooks.cc%3FL2740-2760\n2740: {\n2741:   return false;\n2742: }\n2743: \n2744: /* Default implementation for\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\n2746: HOST_WIDE_INT\n2747: default_stack_clash_protection_alloca_probe_range (void)\n2748: {\n2749:   return 0;\n2750: }\n2751: \n2752: /* The default implementation of TARGET_EARLY_REMAT_MODES.  */\n2753: \n2754: void\n2755: default_select_early_remat_modes (sbitmap)\n2756: {\n2757: }\n2758: \n2759: /* The default implementation of TARGET_PREFERRED_ELSE_VALUE.  */\n2760: \n2761: '}}
63. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"supports_stack_clash_protection\" file:lib"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/lib/target-supports.exp\\n13633: #\\n13634: proc check_effective_target_supports_stack_clash_protection { } {\\n13635: \\n13636: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/lib/target-supports.exp\n13633: #\n13634: proc check_effective_target_supports_stack_clash_protection { } {\n13635: \n13636: \n'}}
64. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"supports_stack_clash_protection\""
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/g++.dg/torture/pr82823.C\\n2: // { dg-additional-options \\"-fstack-clash-protection\\" }\\n3: // { dg-require-effective-target supports_stack_clash_protection }\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/g++.dg/torture/pr119610.C\\n2: // { dg-additional-options \\"-fstack-protector-strong\\" { target fstack_protector } }\\n3: // { dg-additional-options \\"-fstack-clash-protection\\" { target supports_stack_clash_protection } }\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-alloca-2.c\\n2: /* { dg-options \\"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/g++.target/aarch64/sve/pr119610-sve.C\\n2: // { dg-additional-options \\"-fstack-protector-strong\\" { target fstack_protector } }\\n3: // { dg-additional-options \\"-fstack-clash-protection\\" { target supports_stack_clash_protection } }\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-prologue-1.c\\n2: /* { dg-options \\"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-prologue-2.c\\n2: /* { dg-options \\"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-alloca-3.c\\n2: /* { dg-options \\"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/stack-check-alloca-2.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-prologue-3.c\\n2: /* { dg-options \\"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/stack-check-prologue-1.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.dg/pr82788.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-probe-interval=10 --param stack-clash-protection-guard-size=12\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: /* { dg-skip-if \\"RISC-V and AArch64 do not support this interval.\\" { riscv*-*-* aarch64*-*-* } } */\\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/riscv/stack-check-prologue-8.c\\n2: /* { dg-options \\"-O2 -march=rv64gc -mabi=lp64d -fstack-clash-protection\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/stack-check-alloca-3.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16\\" } */\\n3: /* { dg-require-effective-target supports_stack_clash_protection } */\\n4: \\n5: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/aarch64/stack-check-prologue-3.c\\n2: /* { dg-options \\"-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16\\" } */\\n3: /* { ...
65. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"stack_clash_protection_alloca_probe_range\" file:target.h"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
66. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"stack_clash_protection\" file:target.h"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
67. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ TARGET_STACK_CLASH_PROTECTION"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\\n16846: \\n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\\\\n16849:   riscv_stack_clash_protection_alloca_probe_range\\n16850: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.cc\\n2744: /* Default implementation for\\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\\n2746: HOST_WIDE_INT\\n2747: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi\\n3771: \\n3772: @deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void)\\n3773: Some targets have an ABI defined interval for which no probing needs to be done.\\n3774: \\n\\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi.in\\n2997: \\n2998: @hook TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\\n2999: \\n3000: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/config/riscv/riscv.cc\n16846: \n16847: #undef TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n16848: #define TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE \\\n16849:   riscv_stack_clash_protection_alloca_probe_range\n16850: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/targhooks.cc\n2744: /* Default implementation for\n2745:   TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE.  */\n2746: HOST_WIDE_INT\n2747: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi\n3771: \n3772: @deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void)\n3773: Some targets have an ABI defined interval for which no probing needs to be done.\n3774: \n\n# github.com/sg-evals/gcc--96dfb333 – gcc/doc/tm.texi.in\n2997: \n2998: @hook TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\n2999: \n3000: \n'}}
68. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/function.h",
  "startLine": 635,
  "endLine": 655
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/function.h%3FL635-655\\n635:    to this function will have that bit clear.  */\\n636: #define MINIMUM_METHOD_BOUNDARY \\\\\\n637:   ((TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn)\\t     \\\\\\n638:    ? MAX (FUNCTION_BOUNDARY, 2 * BITS_PER_UNIT) : FUNCTION_BOUNDARY)\\n639: \\n640: enum stack_clash_probes {\\n641:   NO_PROBE_NO_FRAME,\\n642:   NO_PROBE_SMALL_FRAME,\\n643:   PROBE_INLINE,\\n644:   PROBE_LOOP\\n645: };\\n646: \\n647: extern void dump_stack_clash_frame_info (enum stack_clash_probes, bool);\\n648: \\f\\n649: \\n650: extern void push_function_context (void);\\n651: extern void pop_function_context (void);\\n652: \\n653: /* Save and restore status information for a nested function.  */\\n654: extern void free_after_parsing (struct function *);\\n655: extern void free_after_compilation (struct function *);\\n656: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/function.h%3FL635-655\n635:    to this function will have that bit clear.  */\n636: #define MINIMUM_METHOD_BOUNDARY \\\n637:   ((TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn)\t     \\\n638:    ? MAX (FUNCTION_BOUNDARY, 2 * BITS_PER_UNIT) : FUNCTION_BOUNDARY)\n639: \n640: enum stack_clash_probes {\n641:   NO_PROBE_NO_FRAME,\n642:   NO_PROBE_SMALL_FRAME,\n643:   PROBE_INLINE,\n644:   PROBE_LOOP\n645: };\n646: \n647: extern void dump_stack_clash_frame_info (enum stack_clash_probes, bool);\n648: \x0c\n649: \n650: extern void push_function_context (void);\n651: extern void pop_function_context (void);\n652: \n653: /* Save and restore status information for a nested function.  */\n654: extern void free_after_parsing (struct function *);\n655: extern void free_after_compilation (struct function *);\n656: '}}
69. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/target.def",
  "startLine": 1,
  "endLine": 50
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/target.def%3FL1-50\\n1: /* Target hook definitions.\\n2:    Copyright (C) 2001-2026 Free Software Foundation, Inc.\\n3: \\n4:    This program is free software; you can redistribute it and/or modify it\\n5:    under the terms of the GNU General Public License as published by the\\n6:    Free Software Foundation; either version 3, or (at your option) any\\n7:    later version.\\n8: \\n9:    This program is distributed in the hope that it will be useful,\\n10:    but WITHOUT ANY WARRANTY; without even the implied warranty of\\n11:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\n12:    GNU General Public License for more details.\\n13: \\n14:    You should have received a copy of the GNU General Public License\\n15:    along with this program; see the file COPYING3.  If not see\\n16:    <http://www.gnu.org/licenses/>.\\n17: \\n18:    In other words, you are welcome to use, share and improve this program.\\n19:    You are forbidden to forbid anyone else to use, share and improve\\n20:    what you give them.   Help stamp out software-hoarding!  */\\n21: \\n22: /* See target-hooks-macros.h for details of macros that should be\\n23:    provided by the including file, and how to use them here.  */\\n24: #include \\"target-hooks-macros.h\\"\\n25: \\n26: #undef HOOK_TYPE\\n27: #define HOOK_TYPE \\"Target Hook\\"\\n28: \\n29: HOOK_VECTOR (TARGET_INITIALIZER, gcc_target)\\n30: \\n31: /* Functions that output assembler for the target.  */\\n32: #define HOOK_PREFIX \\"TARGET_ASM_\\"\\n33: HOOK_VECTOR (TARGET_ASM_OUT, asm_out)\\n34: \\n35: /* Opening and closing parentheses for asm expression grouping.  */\\n36: DEFHOOKPOD\\n37: (open_paren,\\n38:  \\"These target hooks are C string constants, describing the syntax in the\\\\n\\\\\\n39: assembler for grouping arithmetic expressions.  If not overridden, they\\\\n\\\\\\n40: default to normal parentheses, which is correct for most assemblers.\\",\\n41:  const char *, \\"(\\")\\n42: DEFHOOKPODX (close_paren, const char *, \\")\\")\\n43: \\n44: /* Assembler instructions for creating various kinds of integer object.  */\\n45: DEFHOOKPOD\\n46: (byte_op,\\n47:  \\"@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_HI_OP\\\\n\\\\\\n48: @deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PSI_OP\\\\n\\\\\\n49: @deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_SI_OP\\\\n\\\\\\n50: @deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_PDI_OP\\\\n\\\\\\n51: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/target.def%3FL1-50\n1: /* Target hook definitions.\n2:    Copyright (C) 2001-2026 Free Software Foundation, Inc.\n3: \n4:    This program is free software; you can redistribute it and/or modify it\n5:    under the terms of the GNU General Public License as published by the\n6:    Free Software Foundation; either version 3, or (at your option) any\n7:    later version.\n8: \n9:    This program is distributed in the hope that it will be useful,\n10:    but WITHOUT ANY WARRANTY; without even the implied warranty of\n11:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n12:    GNU General Public License for more details.\n13: \n14:    You should have received a copy of the GNU General Public License\n15:    along with this program; see the file COPYING3.  If not see\n16:    <http://www.gnu.org/licenses/>.\n17: \n18:    In other words, you are welcome to use, share and improve this program.\n19:    You are forbidden to forbid anyone else to use, share and improve\n20:    what you give them.   Help stamp out software-hoarding!  */\n21: \n22: /* See target-hooks-macros.h for details of macros that should be\n23:    provided by the including file, and how to use them here.  */\n24: #include "target-hoo...
70. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/config/i386/i386.cc",
  "startLine": 100,
  "endLine": 200
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386.cc%3FL100-200\\n100: #include \\"i386-features.h\\"\\n101: #include \\"function-abi.h\\"\\n102: #include \\"rtl-error.h\\"\\n103: #include \\"gimple-pretty-print.h\\"\\n104: \\n105: /* This file should be included last.  */\\n106: #include \\"target-def.h\\"\\n107: \\n108: static void ix86_print_operand_address_as (FILE *, rtx, addr_space_t, bool);\\n109: static void ix86_emit_restore_reg_using_pop (rtx, bool = false);\\n110: \\n111: \\n112: #ifndef CHECK_STACK_LIMIT\\n113: #define CHECK_STACK_LIMIT (-1)\\n114: #endif\\n115: \\n116: /* Return index of given mode in mult and division cost tables.  */\\n117: #define MODE_INDEX(mode)\\t\\t\\t\\t\\t\\\\\\n118:   ((mode) == QImode ? 0\\t\\t\\t\\t\\t\\t\\\\\\n119:    : (mode) == HImode ? 1\\t\\t\\t\\t\\t\\\\\\n120:    : (mode) == SImode ? 2\\t\\t\\t\\t\\t\\\\\\n121:    : (mode) == DImode ? 3\\t\\t\\t\\t\\t\\\\\\n122:    : 4)\\n123: \\n124: \\n125: /* Set by -mtune.  */\\n126: const struct processor_costs *ix86_tune_cost = NULL;\\n127: \\n128: /* Set by -mtune or -Os.  */\\n129: const struct processor_costs *ix86_cost = NULL;\\n130: \\n131: /* In case the average insn count for single function invocation is\\n132:    lower than this constant, emit fast (but longer) prologue and\\n133:    epilogue code.  */\\n134: #define FAST_PROLOGUE_INSN_COUNT 20\\n135: \\n136: /* Names for 8 (low), 8 (high), and 16-bit registers, respectively.  */\\n137: static const char *const qi_reg_name[] = QI_REGISTER_NAMES;\\n138: static const char *const qi_high_reg_name[] = QI_HIGH_REGISTER_NAMES;\\n139: static const char *const hi_reg_name[] = HI_REGISTER_NAMES;\\n140: \\n141: /* Array of the smallest class containing reg number REGNO, indexed by\\n142:    REGNO.  Used by REGNO_REG_CLASS in i386.h.  */\\n143: \\n144: enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER] =\\n145: {\\n146:   /* ax, dx, cx, bx */\\n147:   AREG, DREG, CREG, BREG,\\n148:   /* si, di, bp, sp */\\n149:   SIREG, DIREG, NON_Q_REGS, NON_Q_REGS,\\n150:   /* FP registers */\\n151:   FP_TOP_REG, FP_SECOND_REG, FLOAT_REGS, FLOAT_REGS,\\n152:   FLOAT_REGS, FLOAT_REGS, FLOAT_REGS, FLOAT_REGS,\\n153:   /* arg pointer, flags, fpsr, frame */\\n154:   NON_Q_REGS, NO_REGS, NO_REGS, NON_Q_REGS,\\n155:   /* SSE registers */\\n156:   SSE_FIRST_REG, SSE_REGS, SSE_REGS, SSE_REGS,\\n157:   SSE_REGS, SSE_REGS, SSE_REGS, SSE_REGS,\\n158:   /* MMX registers */\\n159:   MMX_REGS, MMX_REGS, MMX_REGS, MMX_REGS,\\n160:   MMX_REGS, MMX_REGS, MMX_REGS, MMX_REGS,\\n161:   /* REX registers */\\n162:   GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,\\n163:   GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,\\n164:   /* SSE REX registers */\\n165:   SSE_REGS, SSE_REGS, SSE_REGS, SSE_REGS,\\n166:   SSE_REGS, SSE_REGS, SSE_REGS, SSE_REGS,\\n167:   /* AVX-512 SSE registers */\\n168:   ALL_SSE_REGS, ALL_SSE_REGS, ALL_SSE_REGS, ALL_SSE_REGS,\\n169:   ALL_SSE_REGS, ALL_SSE_REGS, ALL_SSE_REGS, ALL_SSE_REGS,\\n170:   ALL_SSE_REGS, ALL_SSE_REGS, ALL_SSE_REGS, ALL_SSE_REGS,\\n171:   ALL_SSE_REGS, ALL_SSE_REGS, ALL_SSE_REGS, ALL_SSE_REGS,\\n172:   /* Mask registers.  */\\n173:   ALL_MASK_REGS, MASK_REGS, MASK_REGS, MASK_REGS,\\n174:   MASK_REGS, MASK_REGS, MASK_REGS, MASK_REGS,\\n175:   /* REX2 registers */\\n176:   GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,\\n177:   GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,\\n178:   GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,\\n179:   GENERAL_REGS, GENERAL_REGS, GENERAL_REGS, GENERAL_REGS,\\n180: };\\n181: \\n182: /* The \\"default\\" register map used in 32bit mode.  */\\n183: \\n184: unsigned int const debugger_register_map[FIRST_PSEUDO_REGISTER] =\\n185: {\\n186:   /* general regs */\\n187:   0, 2, 1, 3, 6, 7, 4, 5,\\n188:   /* fp regs */\\n189:   12, 13, 14, 15, 16, 17, 18, 19,\\n190:   /* arg, flags, fpsr, frame */\\n191:...
71. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/config/i386/i386-expand.cc",
  "startLine": 1,
  "endLine": 80
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386-expand.cc%3FL1-80\\n1: /* Copyright (C) 1988-2026 Free Software Foundation, Inc.\\n2: \\n3: This file is part of GCC.\\n4: \\n5: GCC is free software; you can redistribute it and/or modify\\n6: it under the terms of the GNU General Public License as published by\\n7: the Free Software Foundation; either version 3, or (at your option)\\n8: any later version.\\n9: \\n10: GCC is distributed in the hope that it will be useful,\\n11: but WITHOUT ANY WARRANTY; without even the implied warranty of\\n12: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\n13: GNU General Public License for more details.\\n14: \\n15: You should have received a copy of the GNU General Public License\\n16: along with GCC; see the file COPYING3.  If not see\\n17: <http://www.gnu.org/licenses/>.  */\\n18: \\n19: #define IN_TARGET_CODE 1\\n20: \\n21: #include \\"config.h\\"\\n22: #include \\"system.h\\"\\n23: #include \\"coretypes.h\\"\\n24: #include \\"backend.h\\"\\n25: #include \\"rtl.h\\"\\n26: #include \\"tree.h\\"\\n27: #include \\"memmodel.h\\"\\n28: #include \\"gimple.h\\"\\n29: #include \\"cfghooks.h\\"\\n30: #include \\"cfgloop.h\\"\\n31: #include \\"df.h\\"\\n32: #include \\"tm_p.h\\"\\n33: #include \\"stringpool.h\\"\\n34: #include \\"expmed.h\\"\\n35: #include \\"optabs.h\\"\\n36: #include \\"regs.h\\"\\n37: #include \\"emit-rtl.h\\"\\n38: #include \\"recog.h\\"\\n39: #include \\"cgraph.h\\"\\n40: #include \\"diagnostic.h\\"\\n41: #include \\"cfgbuild.h\\"\\n42: #include \\"alias.h\\"\\n43: #include \\"fold-const.h\\"\\n44: #include \\"attribs.h\\"\\n45: #include \\"calls.h\\"\\n46: #include \\"stor-layout.h\\"\\n47: #include \\"varasm.h\\"\\n48: #include \\"output.h\\"\\n49: #include \\"insn-attr.h\\"\\n50: #include \\"flags.h\\"\\n51: #include \\"except.h\\"\\n52: #include \\"explow.h\\"\\n53: #include \\"expr.h\\"\\n54: #include \\"cfgrtl.h\\"\\n55: #include \\"common/common-target.h\\"\\n56: #include \\"langhooks.h\\"\\n57: #include \\"reload.h\\"\\n58: #include \\"gimplify.h\\"\\n59: #include \\"dwarf2.h\\"\\n60: #include \\"tm-constrs.h\\"\\n61: #include \\"cselib.h\\"\\n62: #include \\"sched-int.h\\"\\n63: #include \\"opts.h\\"\\n64: #include \\"tree-pass.h\\"\\n65: #include \\"context.h\\"\\n66: #include \\"pass_manager.h\\"\\n67: #include \\"target-globals.h\\"\\n68: #include \\"gimple-iterator.h\\"\\n69: #include \\"shrink-wrap.h\\"\\n70: #include \\"builtins.h\\"\\n71: #include \\"rtl-iter.h\\"\\n72: #include \\"tree-iterator.h\\"\\n73: #include \\"dbgcnt.h\\"\\n74: #include \\"case-cfn-macros.h\\"\\n75: #include \\"dojump.h\\"\\n76: #include \\"fold-const-call.h\\"\\n77: #include \\"tree-vrp.h\\"\\n78: #include \\"tree-ssanames.h\\"\\n79: #include \\"selftest.h\\"\\n80: #include \\"selftest-rtl.h\\"\\n81: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/config/i386/i386-expand.cc%3FL1-80\n1: /* Copyright (C) 1988-2026 Free Software Foundation, Inc.\n2: \n3: This file is part of GCC.\n4: \n5: GCC is free software; you can redistribute it and/or modify\n6: it under the terms of the GNU General Public License as published by\n7: the Free Software Foundation; either version 3, or (at your option)\n8: any later version.\n9: \n10: GCC is distributed in the hope that it will be useful,\n11: but WITHOUT ANY WARRANTY; without even the implied warranty of\n12: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n13: GNU General Public License for more details.\n14: \n15: You should have received a copy of the GNU General Public License\n16: along with GCC; see the file COPYING3.  If not see\n17: <http://www.gnu.org/licenses/>.  */\n18: \n19: #define IN_TARGET_CODE 1\n20: \n21: #include "config.h"\n22: #include "system.h"\n23: #include "coretypes.h"\n24: #inclu...
72. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"stack_clash_protection_probe_range\" file:params.opt"
}

Output

{'content': '{"text":"No results.\\n\\nNo results found."}', 'structuredContent': {'text': 'No results.\n\nNo results found.'}}
73. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ \"stack_clash_protection\" file:params.opt"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/params.opt\\n1108: -param=stack-clash-protection-guard-size=\\n1109: Common Joined UInteger Var(param_stack_clash_protection_guard_size) Init(12) IntegerRange(12, 30) Param Optimization\\n1110: Size of the stack guard expressed as a power of two in bytes.\\n1111: \\n1112: -param=stack-clash-protection-probe-interval=\\n1113: Common Joined UInteger Var(param_stack_clash_protection_probe_interval) Init(12) IntegerRange(10, 16) Param Optimization\\n1114: Interval in which to probe the stack expressed as a power of two in bytes.\\n1115: \\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/params.opt\n1108: -param=stack-clash-protection-guard-size=\n1109: Common Joined UInteger Var(param_stack_clash_protection_guard_size) Init(12) IntegerRange(12, 30) Param Optimization\n1110: Size of the stack guard expressed as a power of two in bytes.\n1111: \n1112: -param=stack-clash-protection-probe-interval=\n1113: Common Joined UInteger Var(param_stack_clash_protection_probe_interval) Init(12) IntegerRange(10, 16) Param Optimization\n1114: Interval in which to probe the stack expressed as a power of two in bytes.\n1115: \n'}}
74. mcp__sourcegraph__sg_keyword_search

Input

{
  "query": "repo:^github.com/sg-evals/gcc--96dfb333$ file:testsuite/gcc.target/i386/stack-clash"
}

Output

{'content': '{"text":"# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-clash-protection.c\\n"}', 'structuredContent': {'text': '# github.com/sg-evals/gcc--96dfb333 – gcc/testsuite/gcc.target/i386/stack-clash-protection.c\n'}}
75. mcp__sourcegraph__sg_read_file

Input

{
  "repo": "github.com/sg-evals/gcc--96dfb333",
  "path": "gcc/explow.cc",
  "startLine": 1920,
  "endLine": 2000
}

Output

{'content': '{"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/explow.cc%3FL1920-2000\\n1920: \\n1921: \\t  if (CONST_INT_P (temp))\\n1922: \\t    {\\n1923: \\t      /* Use [base + disp} addressing mode if supported.  */\\n1924: \\t      HOST_WIDE_INT offset = INTVAL (temp);\\n1925: \\t      addr = memory_address (Pmode,\\n1926: \\t\\t\\t\\t     plus_constant (Pmode, last_addr,\\n1927: \\t\\t\\t\\t\\t\\t    STACK_GROW_OFF (offset)));\\n1928: \\t    }\\n1929: \\t  else\\n1930: \\t    {\\n1931: \\t      /* Manual CSE if the difference is not known at compile-time.  */\\n1932: \\t      temp = gen_rtx_MINUS (Pmode, size, rounded_size_op);\\n1933: \\t      addr = memory_address (Pmode,\\n1934: \\t\\t\\t\\t     gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,\\n1935: \\t\\t\\t\\t\\t\\t     last_addr, temp));\\n1936: \\t    }\\n1937: \\n1938: \\t  emit_stack_probe (addr);\\n1939: \\t}\\n1940:     }\\n1941: \\n1942:   /* Make sure nothing is scheduled before we are done.  */\\n1943:   emit_insn (gen_blockage ());\\n1944: }\\n1945: \\n1946: /* Compute parameters for stack clash probing a dynamic stack\\n1947:    allocation of SIZE bytes.\\n1948: \\n1949:    We compute ROUNDED_SIZE, LAST_ADDR, RESIDUAL and PROBE_INTERVAL.\\n1950: \\n1951:    Additionally we conditionally dump the type of probing that will\\n1952:    be needed given the values computed.  */\\n1953: \\n1954: void\\n1955: compute_stack_clash_protection_loop_data (rtx *rounded_size, rtx *last_addr,\\n1956: \\t\\t\\t\\t\\t  rtx *residual,\\n1957: \\t\\t\\t\\t\\t  HOST_WIDE_INT *probe_interval,\\n1958: \\t\\t\\t\\t\\t  rtx size)\\n1959: {\\n1960:   /* Round SIZE down to STACK_CLASH_PROTECTION_PROBE_INTERVAL */\\n1961:   *probe_interval\\n1962:     = 1 << param_stack_clash_protection_probe_interval;\\n1963:   *rounded_size = simplify_gen_binary (AND, Pmode, size,\\n1964: \\t\\t\\t\\t        GEN_INT (-*probe_interval));\\n1965: \\n1966:   /* Compute the value of the stack pointer for the last iteration.\\n1967:      It\'s just SP + ROUNDED_SIZE.  */\\n1968:   rtx rounded_size_op = force_operand (*rounded_size, NULL_RTX);\\n1969:   *last_addr = force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,\\n1970: \\t\\t\\t\\t\\t      stack_pointer_rtx,\\n1971: \\t\\t\\t\\t\\t      rounded_size_op),\\n1972: \\t\\t\\t      NULL_RTX);\\n1973: \\n1974:   /* Compute any residuals not allocated by the loop above.  Residuals\\n1975:      are just the ROUNDED_SIZE - SIZE.  */\\n1976:   *residual = simplify_gen_binary (MINUS, Pmode, size, *rounded_size);\\n1977: \\n1978:   /* Dump key information to make writing tests easy.  */\\n1979:   if (dump_file)\\n1980:     {\\n1981:       if (*rounded_size == CONST0_RTX (Pmode))\\n1982: \\tfprintf (dump_file,\\n1983: \\t\\t \\"Stack clash skipped dynamic allocation and probing loop.\\\\n\\");\\n1984:       else if (CONST_INT_P (*rounded_size)\\n1985: \\t       && INTVAL (*rounded_size) <= 4 * *probe_interval)\\n1986: \\tfprintf (dump_file,\\n1987: \\t\\t \\"Stack clash dynamic allocation and probing inline.\\\\n\\");\\n1988:       else if (CONST_INT_P (*rounded_size))\\n1989: \\tfprintf (dump_file,\\n1990: \\t\\t \\"Stack clash dynamic allocation and probing in \\"\\n1991: \\t\\t \\"rotated loop.\\\\n\\");\\n1992:       else\\n1993: \\tfprintf (dump_file,\\n1994: \\t\\t \\"Stack clash dynamic allocation and probing in loop.\\\\n\\");\\n1995: \\n1996:       if (*residual != CONST0_RTX (Pmode))\\n1997: \\tfprintf (dump_file,\\n1998: \\t\\t \\"Stack clash dynamic allocation and probing residuals.\\\\n\\");\\n1999:       else\\n2000: \\tfprintf (dump_file,\\n2001: "}', 'structuredContent': {'text': 'URL: https://demo.sourcegraph.com/github.com/sg-evals/gcc--96dfb333@baaf9b33ef307e3d2752a94e62274c374e6a5e20/-/blob/gcc/explow.cc%3FL1920-2000\n1920: \n1921: \t  if (CONST_INT_P (temp))\n1922: \t    {\n1923: \t      /* Use [base + disp} addressing mode if supported.  */\n1924: \t      HOST_WIDE_IN...
76. Write

Input

{
  "file_path": "/workspace/answer.json",
  "content": "{\n  \"files\": [\n    {\"repo\": \"sg-evals/gcc--96dfb333\", \"path\": \"gcc/config/i386/i386.cc\"},\n    {\"repo\": \"sg-evals/gcc--96dfb333\", \"path\": \"gcc/explow.cc\"},\n    {\"repo\": \"sg-evals/gcc--96dfb333\", \"path\": \"gcc/explow.h\"},\n    {\"repo\": \"sg-evals/gcc--96dfb333\", \"path\": \"gcc/target.def\"},\n    {\"repo\": \"sg-evals/gcc--96dfb333\", \"path\": \"gcc/targhooks.h\"},\n    {\"repo\": \"sg-evals/gcc--96dfb333\", \"path\": \"gcc/function.h\"},\n    {\"repo\": \"sg-evals/gcc--96dfb333\", \"path\": \"gcc/testsuite/gcc.target/i386/stack-clash-protection.c\"},\n    {\"repo\": \"sg-evals/gcc--96dfb333\", \"path\": \"gcc/common.opt\"}\n  ],\n  \"symbols\": [\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/config/i386/i386.cc\",\n      \"symbol\": \"output_adjust_stack_and_probe\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/config/i386/i386.cc\",\n      \"symbol\": \"output_probe_stack_range\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/explow.cc\",\n      \"symbol\": \"anti_adjust_stack_and_probe\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/explow.cc\",\n      \"symbol\": \"anti_adjust_stack_and_probe_stack_clash\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/explow.cc\",\n      \"symbol\": \"compute_stack_clash_protection_loop_data\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/explow.cc\",\n      \"symbol\": \"emit_stack_clash_protection_probe_loop_start\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/explow.cc\",\n      \"symbol\": \"emit_stack_clash_protection_probe_loop_end\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/target.def\",\n      \"symbol\": \"TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/targhooks.h\",\n      \"symbol\": \"default_stack_clash_protection_alloca_probe_range\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/function.h\",\n      \"symbol\": \"stack_clash_probes\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/common.opt\",\n      \"symbol\": \"fstack-clash-protection\"\n    }\n  ],\n  \"chain\": [\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/config/i386/i386.cc\",\n      \"symbol\": \"output_adjust_stack_and_probe\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/explow.cc\",\n      \"symbol\": \"anti_adjust_stack_and_probe_stack_clash\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/explow.cc\",\n      \"symbol\": \"compute_stack_clash_protection_loop_data\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/target.def\",\n      \"symbol\": \"TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/testsuite/gcc.target/i386/stack-clash-protection.c\",\n      \"symbol\": \"stack-clash-protection\"\n    },\n    {\n      \"repo\": \"sg-evals/gcc--96dfb333\",\n      \"path\": \"gcc/common.opt\",\n      \"symbol\": \"fstack-clash-protection\"\n    }\n  ],\n  \"text\": \"Stack clash protection in GCC is implemented across several files:\\n\\n1. **gcc/config/i386/i386.cc** — The x86_64/i386 target backend. Implements stack clash probing for x86 via `output_adjust_stack_and_probe` and `output_probe_stack_range`. These functions are declared in `gcc/config/i386/i386-protos.h` and invoked from machine description patterns in `gcc/config/i386/i386.md` (patterns `adjust_stack_and_probe_<mode>` and `probe_stack_range_<mode>`).\\n\\n2. **gcc/explow.cc** — The generic stack clash ex
...

Output

{'type': 'create', 'filePath': '/workspace/answer.json', 'content': '{\n  "files": [\n    {"repo": "sg-evals/gcc--96dfb333", "path": "gcc/config/i386/i386.cc"},\n    {"repo": "sg-evals/gcc--96dfb333", "path": "gcc/explow.cc"},\n    {"repo": "sg-evals/gcc--96dfb333", "path": "gcc/explow.h"},\n    {"repo": "sg-evals/gcc--96dfb333", "path": "gcc/target.def"},\n    {"repo": "sg-evals/gcc--96dfb333", "path": "gcc/targhooks.h"},\n    {"repo": "sg-evals/gcc--96dfb333", "path": "gcc/function.h"},\n    {"repo": "sg-evals/gcc--96dfb333", "path": "gcc/testsuite/gcc.target/i386/stack-clash-protection.c"},\n    {"repo": "sg-evals/gcc--96dfb333", "path": "gcc/common.opt"}\n  ],\n  "symbols": [\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/config/i386/i386.cc",\n      "symbol": "output_adjust_stack_and_probe"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/config/i386/i386.cc",\n      "symbol": "output_probe_stack_range"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/explow.cc",\n      "symbol": "anti_adjust_stack_and_probe"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/explow.cc",\n      "symbol": "anti_adjust_stack_and_probe_stack_clash"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/explow.cc",\n      "symbol": "compute_stack_clash_protection_loop_data"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/explow.cc",\n      "symbol": "emit_stack_clash_protection_probe_loop_start"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/explow.cc",\n      "symbol": "emit_stack_clash_protection_probe_loop_end"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/target.def",\n      "symbol": "TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/targhooks.h",\n      "symbol": "default_stack_clash_protection_alloca_probe_range"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/function.h",\n      "symbol": "stack_clash_probes"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/common.opt",\n      "symbol": "fstack-clash-protection"\n    }\n  ],\n  "chain": [\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/config/i386/i386.cc",\n      "symbol": "output_adjust_stack_and_probe"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/explow.cc",\n      "symbol": "anti_adjust_stack_and_probe_stack_clash"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/explow.cc",\n      "symbol": "compute_stack_clash_protection_loop_data"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/target.def",\n      "symbol": "TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/testsuite/gcc.target/i386/stack-clash-protection.c",\n      "symbol": "stack-clash-protection"\n    },\n    {\n      "repo": "sg-evals/gcc--96dfb333",\n      "path": "gcc/common.opt",\n      "symbol": "fstack-clash-protection"\n    }\n  ],\n  "text": "Stack clash protection in GCC is implemented across several files:\\n\\n1. **gcc/config/i386/i386.cc** — The x86_64/i386 target backend. Implements stack clash probing for x86 via `output_adjust_stack_and_probe` and `output_probe_stack_range`. These functions are declared in `gcc/config/i386/i386-protos.h` and invoked from machine description patterns in `gcc/config/i386/i386.md` (patterns `adjust_stack_and_probe_<mode>` and `probe_stack_range_<mode>`).\\n\\n2. **gcc/explow.cc** — The generic stack clash expansion. Key functions:\\n   - `anti_adjust_stack_and_probe` (line 2200): general stack adjustment with probing\\n   - `anti_adjust_stack_and_probe_stack_clash` (line 2072): stack clash-specific probing that probes every page and never skips probes\\n   - `compute_...
Bash (0)

No bash commands.

Fable 5
baseline checkout, no MCP
0.722 rewardmean 0.735 (n=3)13 turns13 tools$0.98
Instruction sent
# GCC Stack Clash Protection Implementation Audit

## Your Task

Audit the stack clash protection implementation in GCC. Find all C/C++ source files in `gcc-mirror/gcc` that implement stack clash mitigation. Specifically: 1. The file that implements stack clash probing for x86_64 targets (`gcc/config/i386/i386.cc` — look for `stack_clash_protection`). 2. The file that implements the generic stack clash expansion (`gcc/explow.cc` — look for `anti_adjust_stack_and_probe`). 3. The header where `TARGET_STACK_CLASH_PROTECTION` is declared or defined. 4. The test file under `gcc/testsuite/gcc.target/i386/` that validates stack clash protection (look for `stack-clash-*`). 5. The common options file where `-fstack-clash-protection` is defined (`gcc/common.opt`). Report each file path and the key function or definition.

## Context

You are working on a codebase task involving repos from the security domain.

## Available Resources

## Output Format

Use the published task contract:

- `TASK_WORKDIR=/workspace`
- `TASK_REPO_ROOT=/workspace`
- `TASK_OUTPUT=/workspace/answer.json`

Create a file at `TASK_OUTPUT` (`/workspace/answer.json`) with your findings in the following structure:

```json
{
  "files": [
    {"repo": "repo-name", "path": "relative/path/to/file.go"}
  ],
  "symbols": [
    {"repo": "repo-name", "path": "relative/path/to/file.go", "symbol": "SymbolName"}
  ],
  "chain": [
    {"repo": "repo-name", "path": "relative/path/to/file.go", "symbol": "FunctionName"}
  ],
  "text": "Narrative explanation of your findings, citing repos and file paths."
}
```

Include only the fields relevant to this task. Your answer is evaluated against a closed-world oracle — completeness matters.

## Evaluation

Your answer will be scored on:
- **File recall and precision**: Did you find all relevant files?
Conversation (29)
#TypeToolText
1system-
2assistant-
I'll audit the stack clash protection implementation in the GCC repo. Let me start by checking the repo structure.
3assistantBash
4userBash
gcc--96dfb333
llvm-project--a8f3c97d
5assistantBash
6userBash
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog
ChangeLog.jit
ChangeLog.tree-ssa
INSTALL
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
README
SECURITY.txt
ar-lib
c++tools
compile
config
7assistantBash
8userBash
6938:  if (flag_stack_clash_protection)
6940:	    << param_stack_clash_protection_probe_interval);
6992:	  || (flag_stack_clash_protection
8289:  else if (size < (1 << param_stack_clash_protection_guard_size))
9491:      && flag_stack_clash_protection
9assistantBash
10userBash
1644:	anti_adjust_stack_and_probe (size, false);
1646:	anti_adjust_stack_and_probe_stack_clash (size);
2053:   This is subtly different than anti_adjust_stack_and_probe to try and
2063:     2. It never skips probes, whereas anti_adjust_stack_and_probe will
2072:anti_adjust_stack_and_probe_stack_clash (rtx size)
2201:anti_adjust_stack_and_probe (rtx size, bool adjust_back)
11assistantBash
12userBash
---
/workspace/gcc--96dfb333/gcc/explow.h
/workspace/gcc--96dfb333/gcc/function.h
/workspace/gcc--96dfb333/gcc/targhooks.h
13assistantBash
14userBash
/workspace/gcc--96dfb333/gcc/testsuite/gcc.target/i386/stack-clash-protection.c
---
3054:fstack-clash-protection
15assistantBash
16userBash
---
/workspace/gcc--96dfb333/gcc/function.h:640:enum stack_clash_probes {
/workspace/gcc--96dfb333/gcc/function.h:647:extern void dump_stack_clash_frame_info (enum stack_clash_probes, bool);
/workspace/gcc--96dfb333/gcc/targhooks.h:305:extern HOST_WIDE_INT default_stack_clash_protection_alloca_probe_range (void);
/workspace/gcc--96dfb333/gcc/explow.h:78:extern void anti_adjust_stack_and_probe_stack_clash (rtx);
/workspace/gcc--96dfb333/gcc/explow.h:82:extern void compute_stack_clash_protection_loop_data (rtx *, rtx *, rtx *,
/workspace/gcc--96dfb333/gcc/explow.h:84:extern void emit_stack_clash_protection_probe_loop_start (rtx *, rtx *,
/workspace/gcc--96dfb333/gcc/explow.h:86:extern void emit_stack_clash_protection_probe_loop_end (rtx, rtx,
17assistantBash
18userBash
---
/workspace/gcc--96dfb333/gcc/doc/tm.texi
19assistantBash
20userBash
3772:@deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void)
---
/workspace/gcc--96dfb333/gcc/target.def:6535:(stack_clash_protection_alloca_probe_range,
/workspace/gcc--96dfb333/gcc/target.def:6545: default_stack_clash_protection_alloca_probe_range)
---
/workspace/gcc--96dfb333/gcc/doc/tm.texi.in
2998:@hook TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE
21assistantBash
22userBash
{
  struct ix86_frame &frame = cfun->machine->frame;

  if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
    return frame.hard_frame_pointer_offset;
  else if (from == FRAME_POINTER_REGNUM
	   && to == HARD_FRAME_POINTER_REGNUM)
    return frame.hard_frame_pointer_offset - frame.frame_pointer_offset;
  else
    {
      gcc_assert (to == STACK_POINTER_REGNUM);

      if (from == ARG_POINTER_REGNUM)
	return frame.stack_pointer_offset;

      gcc_assert (from == FRAME_POINTER_REGNUM);
      return frame.stack_pointer_offset - frame.frame_pointer_offset;
    }
}

/* Emits a warning for unsupported msabi to sysv pro/epilogues.  */
void
warn_once_call_ms2sysv_xlogues (const char *feature)
{
  static bool warned_once = false;
  if (!warned_once)
    {
      warning (0, "%<-mcall-ms2sysv-xlogues%> is not compatible with %s",
	       feature);
      warned_once = true;
    }
}

/* Return the probing interval for -fstack-clash-protection.  */

static HOST_WIDE_INT
get_probe_interval (void)
{
  if (flag_stack_clash_protection)
    return (HOST_WIDE_INT_1U
	    << param_stack_clash_protection_probe_interval);
  else
    return (HOST_WIDE_INT_1U << STACK_CHECK_PROBE_INTERVAL_EXP);
}

/* When using -fsplit-stack, the allocation routines set a field in
====
8215:ix86_adjust_stack_and_probe (HOST_WIDE_INT size,
8463:ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size,
23assistantBash
24userBash
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-clash-protection" } */

int flag;
void open();
int getChar();
typedef enum { QUOTE } CharType;
typedef enum { UNQ } State;
CharType getCharType();
void expand() {
  open();
  if (flag)
    return;
  int ch = getChar();
  State nextState = getCharType();
  if (nextState)
    while (ch)
      ;
}
====
fstack-check
Common Alias(fstack-check=, specific, no)
Insert stack checking code into the program.  Same as -fstack-check=specific.

fstack-clash-protection
Common Var(flag_stack_clash_protection) Optimization
Insert code to probe each page of stack space as it is allocated to protect
from stack-clash style attacks.

; The real option is fno-stack-limit.
fstack-limit
====
/workspace/gcc--96dfb333/gcc/params.opt:1109:Common Joined UInteger Var(param_stack_clash_protection_guard_size) Init(12) IntegerRange(12, 30) Param Optimization
/workspace/gcc--96dfb333/gcc/params.opt:1113:Common Joined UInteger Var(param_stack_clash_protection_probe_interval) Init(12) IntegerRange(10, 16) Param Optimization
25assistantBash
26userBash
2747:default_stack_clash_protection_alloca_probe_range (void)
these registers when the target switches are opposed to them.)",
 void, (void),
 hook_void_void)

DEFHOOK
(stack_clash_protection_alloca_probe_range,
 "Some targets have an ABI defined interval for which no probing needs to be done.\n\
When a probe does need to be done this same interval is used as the probe distance\n\
up when doing stack clash protection for alloca.\n\
On such targets this value can be set to override the default probing up interval.\n\
Define this variable to return nonzero if such a probe range is required or zero otherwise.\n\
Defining this hook also requires your functions which make use of alloca to have at least 8 byes\n\
of outgoing arguments.  If this is not the case the stack will be corrupted.\n\
You need not define this macro if it would always have the value zero.",
 HOST_WIDE_INT, (void),
 default_stack_clash_protection_alloca_probe_range)
27assistantWrite
28userWrite
File created successfully at: /workspace/answer.json (file state is current in your context — no need to Read it back)
29assistant-
Audit complete — all five requested components were located in the GCC repo (`/workspace/gcc--96dfb333`), and the findings are written to `/workspace/answer.json`.

**Findings:**

1. **x86_64 stack clash probing** — `gcc/config/i386/i386.cc`. The key function is `ix86_adjust_stack_and_probe` (line ~8215), which emits the prologue probing sequence and reads `param_stack_clash_protection_guard_size`. Supporting functions are `get_probe_interval` (line ~6937, returns the probe interval for `-fstack-clash-protection`) and `ix86_emit_probe_stack_range` (line ~8463).

2. **Generic stack clash expansion** — `gcc/explow.cc`. The function `anti_adjust_stack_and_probe_stack_clash` (line 2072) implements the never-skip-probes allocation loop, dispatched from `allocate_dynamic_stack_space` at lines 1644–1646 alongside the older `anti_adjust_stack_and_probe`. Declarations and the probe-loop helpers live in `gcc/explow.h`.

3. **The TARGET hook** — there is no bare `TARGET_STACK_CLASH_PROTECTION` macro; the actual hook is `TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE`, defined via `DEFHOOK (stack_clash_protection_alloca_probe_range, ...)` in `gcc/target.def:6535`. Its default implementation `default_stack_clash_protection_alloca_probe_range` is declared in `gcc/targhooks.h:305` and defined in `gcc/targhooks.cc:2747`.

4. **Test file** — `gcc/testsuite/gcc.target/i386/stack-clash-protection.c`, a `dg-do compile` test with `dg-options "-O2 -fstack-clash-protection"`.

5. **Option definition** — `gcc/common.opt:3054` defines `fstack-clash-protection` as `Common Var(flag_stack_clash_protection) Optimization`. The related tunables (`param_stack_clash_protection_guard_size`, `param_stack_clash_protection_probe_interval`) are in `gcc/params.opt`.

This was an analysis-only task, so `ans...
Tool calls (13)
1. Bash

Input

{
  "command": "ls /workspace/ && ls /workspace/gcc-mirror 2>/dev/null | head",
  "description": "List workspace contents"
}

Output

{'stdout': 'gcc--96dfb333\nllvm-project--a8f3c97d', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
2. Bash

Input

{
  "command": "ls /workspace/gcc--96dfb333 | head -20",
  "description": "List gcc repo top-level"
}

Output

{'stdout': 'ABOUT-NLS\nCOPYING\nCOPYING.LIB\nCOPYING.RUNTIME\nCOPYING3\nCOPYING3.LIB\nChangeLog\nChangeLog.jit\nChangeLog.tree-ssa\nINSTALL\nMAINTAINERS\nMakefile.def\nMakefile.in\nMakefile.tpl\nREADME\nSECURITY.txt\nar-lib\nc++tools\ncompile\nconfig', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
3. Bash

Input

{
  "command": "grep -n \"stack_clash_protection\" /workspace/gcc--96dfb333/gcc/config/i386/i386.cc | head -20",
  "description": "Find stack clash references in i386.cc"
}

Output

{'stdout': '6938:  if (flag_stack_clash_protection)\n6940:\t    << param_stack_clash_protection_probe_interval);\n6992:\t  || (flag_stack_clash_protection\n8289:  else if (size < (1 << param_stack_clash_protection_guard_size))\n9491:      && flag_stack_clash_protection', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
4. Bash

Input

{
  "command": "grep -n \"anti_adjust_stack_and_probe\" /workspace/gcc--96dfb333/gcc/explow.cc | head",
  "description": "Find anti_adjust_stack_and_probe in explow.cc"
}

Output

{'stdout': '1644:\tanti_adjust_stack_and_probe (size, false);\n1646:\tanti_adjust_stack_and_probe_stack_clash (size);\n2053:   This is subtly different than anti_adjust_stack_and_probe to try and\n2063:     2. It never skips probes, whereas anti_adjust_stack_and_probe will\n2072:anti_adjust_stack_and_probe_stack_clash (rtx size)\n2201:anti_adjust_stack_and_probe (rtx size, bool adjust_back)', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
5. Bash

Input

{
  "command": "grep -rn \"TARGET_STACK_CLASH_PROTECTION\" /workspace/gcc--96dfb333/gcc --include=\"*.h\" | head; echo ---; grep -rln \"stack_clash\" /workspace/gcc--96dfb333/gcc/config/i386/*.h /workspace/gcc--96dfb333/gcc/*.h 2>/dev/null | head",
  "description": "Search headers for TARGET_STACK_CLASH_PROTECTION"
}

Output

{'stdout': '---\n/workspace/gcc--96dfb333/gcc/explow.h\n/workspace/gcc--96dfb333/gcc/function.h\n/workspace/gcc--96dfb333/gcc/targhooks.h', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
6. Bash

Input

{
  "command": "ls /workspace/gcc--96dfb333/gcc/testsuite/gcc.target/i386/stack-clash-* 2>/dev/null; echo ---; grep -n \"fstack-clash-protection\" /workspace/gcc--96dfb333/gcc/common.opt",
  "description": "Find i386 stack-clash tests and common.opt entry"
}

Output

{'stdout': '/workspace/gcc--96dfb333/gcc/testsuite/gcc.target/i386/stack-clash-protection.c\n---\n3054:fstack-clash-protection', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
7. Bash

Input

{
  "command": "grep -rn \"TARGET_STACK_CLASH_PROTECTION\" /workspace/gcc--96dfb333/gcc/*.h /workspace/gcc--96dfb333/gcc/*.def /workspace/gcc--96dfb333/gcc/config/i386/ 2>/dev/null | head; echo ---; grep -n \"stack_clash\" /workspace/gcc--96dfb333/gcc/explow.h /workspace/gcc--96dfb333/gcc/function.h /workspace/gcc--96dfb333/gcc/targhooks.h",
  "description": "Locate TARGET_STACK_CLASH_PROTECTION declaration"
}

Output

{'stdout': '---\n/workspace/gcc--96dfb333/gcc/function.h:640:enum stack_clash_probes {\n/workspace/gcc--96dfb333/gcc/function.h:647:extern void dump_stack_clash_frame_info (enum stack_clash_probes, bool);\n/workspace/gcc--96dfb333/gcc/targhooks.h:305:extern HOST_WIDE_INT default_stack_clash_protection_alloca_probe_range (void);\n/workspace/gcc--96dfb333/gcc/explow.h:78:extern void anti_adjust_stack_and_probe_stack_clash (rtx);\n/workspace/gcc--96dfb333/gcc/explow.h:82:extern void compute_stack_clash_protection_loop_data (rtx *, rtx *, rtx *,\n/workspace/gcc--96dfb333/gcc/explow.h:84:extern void emit_stack_clash_protection_probe_loop_start (rtx *, rtx *,\n/workspace/gcc--96dfb333/gcc/explow.h:86:extern void emit_stack_clash_protection_probe_loop_end (rtx, rtx,', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
8. Bash

Input

{
  "command": "grep -rn \"STACK_CLASH_PROTECTION\" /workspace/gcc--96dfb333/gcc/target.def /workspace/gcc--96dfb333/gcc/defaults.h 2>/dev/null | head; echo ---; grep -rln \"TARGET_STACK_CLASH_PROTECTION\" /workspace/gcc--96dfb333/gcc --include=\"*.h\" --include=\"*.def\" --include=\"*.texi\" 2>/dev/null | head",
  "description": "Search target.def and docs for the hook"
}

Output

{'stdout': '---\n/workspace/gcc--96dfb333/gcc/doc/tm.texi', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
9. Bash

Input

{
  "command": "grep -n \"TARGET_STACK_CLASH_PROTECTION\" /workspace/gcc--96dfb333/gcc/doc/tm.texi | head; echo ---; grep -rn \"stack_clash\" /workspace/gcc--96dfb333/gcc/target.def | head; echo ---; ls /workspace/gcc--96dfb333/gcc/doc/tm.texi.in 2>/dev/null && grep -n \"STACK_CLASH\" /workspace/gcc--96dfb333/gcc/doc/tm.texi.in | head",
  "description": "Inspect tm.texi and target.def for stack clash hook"
}

Output

{'stdout': '3772:@deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void)\n---\n/workspace/gcc--96dfb333/gcc/target.def:6535:(stack_clash_protection_alloca_probe_range,\n/workspace/gcc--96dfb333/gcc/target.def:6545: default_stack_clash_protection_alloca_probe_range)\n---\n/workspace/gcc--96dfb333/gcc/doc/tm.texi.in\n2998:@hook TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
10. Bash

Input

{
  "command": "sed -n 6900,6945p /workspace/gcc--96dfb333/gcc/config/i386/i386.cc; echo ====; grep -n \"^ix86_adjust_stack_and_probe\\|^ix86_emit_probe_stack_range\\|static void.*probe\" /workspace/gcc--96dfb333/gcc/config/i386/i386.cc | head",
  "description": "View stack clash code in i386.cc"
}

Output

{'stdout': '{\n  struct ix86_frame &frame = cfun->machine->frame;\n\n  if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)\n    return frame.hard_frame_pointer_offset;\n  else if (from == FRAME_POINTER_REGNUM\n\t   && to == HARD_FRAME_POINTER_REGNUM)\n    return frame.hard_frame_pointer_offset - frame.frame_pointer_offset;\n  else\n    {\n      gcc_assert (to == STACK_POINTER_REGNUM);\n\n      if (from == ARG_POINTER_REGNUM)\n\treturn frame.stack_pointer_offset;\n\n      gcc_assert (from == FRAME_POINTER_REGNUM);\n      return frame.stack_pointer_offset - frame.frame_pointer_offset;\n    }\n}\n\n/* Emits a warning for unsupported msabi to sysv pro/epilogues.  */\nvoid\nwarn_once_call_ms2sysv_xlogues (const char *feature)\n{\n  static bool warned_once = false;\n  if (!warned_once)\n    {\n      warning (0, "%<-mcall-ms2sysv-xlogues%> is not compatible with %s",\n\t       feature);\n      warned_once = true;\n    }\n}\n\n/* Return the probing interval for -fstack-clash-protection.  */\n\nstatic HOST_WIDE_INT\nget_probe_interval (void)\n{\n  if (flag_stack_clash_protection)\n    return (HOST_WIDE_INT_1U\n\t    << param_stack_clash_protection_probe_interval);\n  else\n    return (HOST_WIDE_INT_1U << STACK_CHECK_PROBE_INTERVAL_EXP);\n}\n\n/* When using -fsplit-stack, the allocation routines set a field in\n====\n8215:ix86_adjust_stack_and_probe (HOST_WIDE_INT size,\n8463:ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size,', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
11. Bash

Input

{
  "command": "head -20 /workspace/gcc--96dfb333/gcc/testsuite/gcc.target/i386/stack-clash-protection.c; echo ====; sed -n 3050,3060p /workspace/gcc--96dfb333/gcc/common.opt; echo ====; grep -rn \"stack_clash\" /workspace/gcc--96dfb333/gcc/defaults.h /workspace/gcc--96dfb333/gcc/flag-types.h /workspace/gcc--96dfb333/gcc/params.opt 2>/dev/null | head",
  "description": "Check test file, common.opt, and params"
}

Output

{'stdout': '/* { dg-do compile } */\n/* { dg-options "-O2 -fstack-clash-protection" } */\n\nint flag;\nvoid open();\nint getChar();\ntypedef enum { QUOTE } CharType;\ntypedef enum { UNQ } State;\nCharType getCharType();\nvoid expand() {\n  open();\n  if (flag)\n    return;\n  int ch = getChar();\n  State nextState = getCharType();\n  if (nextState)\n    while (ch)\n      ;\n}\n====\nfstack-check\nCommon Alias(fstack-check=, specific, no)\nInsert stack checking code into the program.  Same as -fstack-check=specific.\n\nfstack-clash-protection\nCommon Var(flag_stack_clash_protection) Optimization\nInsert code to probe each page of stack space as it is allocated to protect\nfrom stack-clash style attacks.\n\n; The real option is fno-stack-limit.\nfstack-limit\n====\n/workspace/gcc--96dfb333/gcc/params.opt:1109:Common Joined UInteger Var(param_stack_clash_protection_guard_size) Init(12) IntegerRange(12, 30) Param Optimization\n/workspace/gcc--96dfb333/gcc/params.opt:1113:Common Joined UInteger Var(param_stack_clash_protection_probe_interval) Init(12) IntegerRange(10, 16) Param Optimization', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
12. Bash

Input

{
  "command": "grep -n \"default_stack_clash_protection_alloca_probe_range\" /workspace/gcc--96dfb333/gcc/targhooks.cc; sed -n 6530,6546p /workspace/gcc--96dfb333/gcc/target.def",
  "description": "Confirm hook definition and default implementation"
}

Output

{'stdout': '2747:default_stack_clash_protection_alloca_probe_range (void)\nthese registers when the target switches are opposed to them.)",\n void, (void),\n hook_void_void)\n\nDEFHOOK\n(stack_clash_protection_alloca_probe_range,\n "Some targets have an ABI defined interval for which no probing needs to be done.\\n\\\nWhen a probe does need to be done this same interval is used as the probe distance\\n\\\nup when doing stack clash protection for alloca.\\n\\\nOn such targets this value can be set to override the default probing up interval.\\n\\\nDefine this variable to return nonzero if such a probe range is required or zero otherwise.\\n\\\nDefining this hook also requires your functions which make use of alloca to have at least 8 byes\\n\\\nof outgoing arguments.  If this is not the case the stack will be corrupted.\\n\\\nYou need not define this macro if it would always have the value zero.",\n HOST_WIDE_INT, (void),\n default_stack_clash_protection_alloca_probe_range)', 'stderr': '', 'interrupted': False, 'isImage': False, 'noOutputExpected': False}
13. Write

Input

{
  "file_path": "/workspace/answer.json",
  "content": "{\n  \"files\": [\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/config/i386/i386.cc\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/explow.cc\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/explow.h\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/target.def\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/targhooks.h\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/targhooks.cc\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/testsuite/gcc.target/i386/stack-clash-protection.c\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/common.opt\"}\n  ],\n  \"symbols\": [\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/config/i386/i386.cc\", \"symbol\": \"ix86_adjust_stack_and_probe\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/config/i386/i386.cc\", \"symbol\": \"ix86_emit_probe_stack_range\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/config/i386/i386.cc\", \"symbol\": \"get_probe_interval\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/explow.cc\", \"symbol\": \"anti_adjust_stack_and_probe_stack_clash\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/explow.cc\", \"symbol\": \"anti_adjust_stack_and_probe\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/explow.h\", \"symbol\": \"anti_adjust_stack_and_probe_stack_clash\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/target.def\", \"symbol\": \"TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/targhooks.h\", \"symbol\": \"default_stack_clash_protection_alloca_probe_range\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/targhooks.cc\", \"symbol\": \"default_stack_clash_protection_alloca_probe_range\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/common.opt\", \"symbol\": \"fstack-clash-protection\"}\n  ],\n  \"chain\": [\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/common.opt\", \"symbol\": \"fstack-clash-protection\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/explow.cc\", \"symbol\": \"anti_adjust_stack_and_probe_stack_clash\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/config/i386/i386.cc\", \"symbol\": \"ix86_adjust_stack_and_probe\"},\n    {\"repo\": \"gcc-mirror/gcc\", \"path\": \"gcc/target.def\", \"symbol\": \"TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE\"}\n  ],\n  \"text\": \"Audit of GCC's stack clash protection implementation (repo gcc-mirror/gcc, checked out at /workspace/gcc--96dfb333). (1) x86_64 target probing: gcc/config/i386/i386.cc — ix86_adjust_stack_and_probe (line ~8215) emits the stack-clash probing sequence in the prologue, consulting flag_stack_clash_protection and param_stack_clash_protection_guard_size/probe_interval; get_probe_interval (line ~6937) returns the probing interval for -fstack-clash-protection, and ix86_emit_probe_stack_range (line ~8463) emits explicit probe ranges. (2) Generic expansion: gcc/explow.cc — anti_adjust_stack_and_probe_stack_clash (line 2072) implements the generic stack-clash-safe allocation/probe loop used by allocate_dynamic_stack_space (dispatched at lines 1644-1646), alongside the older anti_adjust_stack_and_probe (line 2201); these are declared in gcc/explow.h together with the probe-loop helpers (compute_stack_clash_protection_loop_data, emit_stack_clash_protection_probe_loop_start/end). (3) The TARGET_STACK_CLASH_PROTECTION hook: the target hook is TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE, defined via DEFHOOK(stack_clash_protection_alloca_probe_range, ...) in gcc/target.def (line 6535); its default implementation default_stack_clash_protection_alloca_probe_range is declared in gcc/targhooks.h (line 305) and defined in gcc/targhooks.cc (line 2747). No standalone TARGET_STACK_CLASH_PROTECTION macro exists in headers — the hook above is the canonical declaration (documented in gcc/doc/tm.texi). (4) Test: gcc/testsuite/gcc.target/i386/stack-clash-protection.c 
...

Output

{'type': 'create', 'filePath': '/workspace/answer.json', 'content': '{\n  "files": [\n    {"repo": "gcc-mirror/gcc", "path": "gcc/config/i386/i386.cc"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/explow.cc"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/explow.h"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/target.def"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/targhooks.h"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/targhooks.cc"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/testsuite/gcc.target/i386/stack-clash-protection.c"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/common.opt"}\n  ],\n  "symbols": [\n    {"repo": "gcc-mirror/gcc", "path": "gcc/config/i386/i386.cc", "symbol": "ix86_adjust_stack_and_probe"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/config/i386/i386.cc", "symbol": "ix86_emit_probe_stack_range"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/config/i386/i386.cc", "symbol": "get_probe_interval"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/explow.cc", "symbol": "anti_adjust_stack_and_probe_stack_clash"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/explow.cc", "symbol": "anti_adjust_stack_and_probe"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/explow.h", "symbol": "anti_adjust_stack_and_probe_stack_clash"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/target.def", "symbol": "TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/targhooks.h", "symbol": "default_stack_clash_protection_alloca_probe_range"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/targhooks.cc", "symbol": "default_stack_clash_protection_alloca_probe_range"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/common.opt", "symbol": "fstack-clash-protection"}\n  ],\n  "chain": [\n    {"repo": "gcc-mirror/gcc", "path": "gcc/common.opt", "symbol": "fstack-clash-protection"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/explow.cc", "symbol": "anti_adjust_stack_and_probe_stack_clash"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/config/i386/i386.cc", "symbol": "ix86_adjust_stack_and_probe"},\n    {"repo": "gcc-mirror/gcc", "path": "gcc/target.def", "symbol": "TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE"}\n  ],\n  "text": "Audit of GCC\'s stack clash protection implementation (repo gcc-mirror/gcc, checked out at /workspace/gcc--96dfb333). (1) x86_64 target probing: gcc/config/i386/i386.cc — ix86_adjust_stack_and_probe (line ~8215) emits the stack-clash probing sequence in the prologue, consulting flag_stack_clash_protection and param_stack_clash_protection_guard_size/probe_interval; get_probe_interval (line ~6937) returns the probing interval for -fstack-clash-protection, and ix86_emit_probe_stack_range (line ~8463) emits explicit probe ranges. (2) Generic expansion: gcc/explow.cc — anti_adjust_stack_and_probe_stack_clash (line 2072) implements the generic stack-clash-safe allocation/probe loop used by allocate_dynamic_stack_space (dispatched at lines 1644-1646), alongside the older anti_adjust_stack_and_probe (line 2201); these are declared in gcc/explow.h together with the probe-loop helpers (compute_stack_clash_protection_loop_data, emit_stack_clash_protection_probe_loop_start/end). (3) The TARGET_STACK_CLASH_PROTECTION hook: the target hook is TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE, defined via DEFHOOK(stack_clash_protection_alloca_probe_range, ...) in gcc/target.def (line 6535); its default implementation default_stack_clash_protection_alloca_probe_range is declared in gcc/targhooks.h (line 305) and defined in gcc/targhooks.cc (line 2747). No standalone TARGET_STACK_CLASH_PROTECTION macro exists in headers — the hook above is the canonical declaration (documented in gcc/doc/tm.texi). (4) Test: gcc/testsuite/gcc.target/i386/stack-clash-protection.c — a dg-do compile test with dg-options \\"-O2 -fstack-clash-protection\\" validating the x86 stack clash protection codegen path. (5) Option definition: gcc/common.opt line 3054 defines fstack-clash-protection (Common Var(flag_s...
Bash (12)
1. $ ls /workspace/ && ls /workspace/gcc-mirror 2>/dev/null | head
2. $ ls /workspace/gcc--96dfb333 | head -20
3. $ grep -n "stack_clash_protection" /workspace/gcc--96dfb333/gcc/config/i386/i386.cc | head -20
4. $ grep -n "anti_adjust_stack_and_probe" /workspace/gcc--96dfb333/gcc/explow.cc | head
5. $ grep -rn "TARGET_STACK_CLASH_PROTECTION" /workspace/gcc--96dfb333/gcc --include="*.h" | head; echo ---; grep -rln "stack_clash" /workspace/gcc--96dfb333/gcc/config/i386/*.h /workspace/gcc--96dfb333/gcc/*.h 2>/dev/null | head
6. $ ls /workspace/gcc--96dfb333/gcc/testsuite/gcc.target/i386/stack-clash-* 2>/dev/null; echo ---; grep -n "fstack-clash-protection" /workspace/gcc--96dfb333/gcc/common.opt
7. $ grep -rn "TARGET_STACK_CLASH_PROTECTION" /workspace/gcc--96dfb333/gcc/*.h /workspace/gcc--96dfb333/gcc/*.def /workspace/gcc--96dfb333/gcc/config/i386/ 2>/dev/null | head; echo ---; grep -n "stack_clash" /workspace/gcc--96dfb333/gcc/explow.h /workspace/gcc--96dfb333/gcc/function.h /workspace/gcc--96dfb333/gcc/targhooks.h
8. $ grep -rn "STACK_CLASH_PROTECTION" /workspace/gcc--96dfb333/gcc/target.def /workspace/gcc--96dfb333/gcc/defaults.h 2>/dev/null | head; echo ---; grep -rln "TARGET_STACK_CLASH_PROTECTION" /workspace/gcc--96dfb333/gcc --include="*.h" --include="*.def" --include="*.texi" 2>/dev/null | head
9. $ grep -n "TARGET_STACK_CLASH_PROTECTION" /workspace/gcc--96dfb333/gcc/doc/tm.texi | head; echo ---; grep -rn "stack_clash" /workspace/gcc--96dfb333/gcc/target.def | head; echo ---; ls /workspace/gcc--96dfb333/gcc/doc/tm.texi.in 2>/dev/null && grep -n "STACK_CLASH" /workspace/gcc--96dfb333/gcc/doc/tm.texi.in | head
10. $ sed -n 6900,6945p /workspace/gcc--96dfb333/gcc/config/i386/i386.cc; echo ====; grep -n "^ix86_adjust_stack_and_probe\|^ix86_emit_probe_stack_range\|static void.*probe" /workspace/gcc--96dfb333/gcc/config/i386/i386.cc | head
11. $ head -20 /workspace/gcc--96dfb333/gcc/testsuite/gcc.target/i386/stack-clash-protection.c; echo ====; sed -n 3050,3060p /workspace/gcc--96dfb333/gcc/common.opt; echo ====; grep -rn "stack_clash" /workspace/gcc--96dfb333/gcc/defaults.h /workspace/gcc--96dfb333/gcc/flag-types.h /workspace/gcc--96dfb333/gcc/params.opt 2>/dev/null | head
12. $ grep -n "default_stack_clash_protection_alloca_probe_range" /workspace/gcc--96dfb333/gcc/targhooks.cc; sed -n 6530,6546p /workspace/gcc--96dfb333/gcc/target.def